How to redirect or add domain to roundcube webmaill http address?


I would like to have my base domain as well as the alias redirect to webmail. For example, goes to roundcube but I would like to be able to go as well go to roundcube. How do you do this? Do I change the nginx file in connf.d and do a rewrite rule? Any code would help.


Hello. Please see


According to the git convo. I need to add a folder called “includes” in “/etc/nginx/conf.d” ? Then add a file to redirect from base domain to domain/mail, is this correct? Do I need to add include statement in any other file or is this automatically done? I tried this option with no success. I restarted and did a nginx -t check and both were fine but no redirect.

I don’t understand the managment/ file. I’m not sure how to use it for my needs. I need to pass something like config file, assuming that would be the nginx file for which I want to add to the server. Which function do I use or a example would be great?

I went with a third option, which is probaly the worst option. I edited the local.conf file and edit the 443 for my base domain and comment out these lines.

 #root /home/user-data/www/default;
 #index index.html index.htm;

and added this line. I restarted and it works. for both and

rewrite ^/$ /mail redirect;

Nginx/MIAB hardening (security)

Old topic, but still unsolved!

I created a file in /etc/nginx/conf.d/includes/ containing:

rewrite ^/$ /mail redirect;

Then ran /root/mailinabox/tools/web_update. It did not make any changes to my local.conf file. For good measure I copied the file to /etc/nginx/conf.d/includes/ (matching the hostname I use) and that did not get included either, even though there are sections in my local.conf for both and How is this supposed to work?