Forward all http requests to different domain hosted on Mail-in-a-box


I would like to redirect everything going to and to which is on the same box.

I tried adding a CNAME record from to but that shows the default page of mail in a box.

;   IN      A

;; ANSWER SECTION: 1800 IN    CNAME   992     IN      A

I think it is going in circles… from it is forwarded to the box ip which then uses the default page of

I guess I could just modify nginx configuration but maybe there is a built in solution for that.

I suppose you could try making a symbolic link from /home/user-data/www/default to wherever the root of your files for are at. I don’t believe you need to deal with DNS settings if I understand that the files are all on a single VPS.

Here is the digitalocean doco on redirects for Apache and Nginx.
I know for sure this works in Apache.
I haven’t tried nginx though MIAB runs nginx.
The DO doco should specify whether the redirect is temporary 302 or permanent 301.
You should in your redirect specify one or the other.


Will a NGINX config change persist after a MIAB upgrade?

Every time I ssh into my box.domainname.tld I look to see if DigitalOcean/Ubuntu changes are needed. If so, I run:
sudo apt-get update && sudo apt-get upgrade -y
to update my box.

I could very well easily put the CLI stated above in a bash shell script that greps on Apache or Nginx conf to see if there have been any changes to the redirect 302 and if so reinstate the redirect.

There is an undocumented feature to create redirects:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.