Mailinabox: How to configure domain redirects

Mailinabox usually wants control over the base domain (so that it can handle emails to that doain). For me this meant the domain was controlled by mailinabox.

Since the website runs at I needed a clean way to redirect.

Fortunately mailinabox supports overwriting the nginx configuration for domains. This can be achieved by adding a file [domainname.tld].conf in the /home/user-data/www/ folder. For me this meant creating /home/user-data/www/ with the following content:

location / {
  return 301$request_uri;

To apply the changes, you will need to run the ./web_update script at ~/mailinabox/tools and also restart nginx with service nginx restart.

Now all URL calls from are being redirected to