I would be interested in re-directing the default page:
"this is a mail-in-a-box
take control of your email at https://mailinabox.email/"
to go straight to /mail. So when a user accesses http://mail.domain.com it will be redirected to https://mail.domain.com/mail (the http to https already works out of the box).
Kinda late to the party but I was wondering if that wonāt be overwritten. The file warns for this at the top. Now Iām thinking Iād rather solve this in a separate .conf but Iām struggling with that.
I indeed saw that post after my response here but didnāt really like it that much. I thought doing a refresh this way leaves room for the client to do with the refresh as it pleases? Maybe Iām mistaken.
Normally Iād try doing it with a header(ālocation: ā¦ā); in an index.php but for that Iād also have to alter /etc/nginx/conf.d/local.conf since that isnāt in the index directive there. But that brings us back to square one I guess
Anyway, Iāll give that solution a go. Really like MIAB so this is a minor āinconvenienceā at most.
I did this with a simple meta redirect in HTML, on an otherwise empty index page at / (which for me is the /home/user-data/www/default/ since I donāt host sites on my MIAB)
What I did: /etc/nginx/conf.d/local.conf is an autogenerated file. So if you add a 301 you probably will lose that change.
I looked for the file that generates it (the important part) find / -name "nginx-primaryonly.conf" and I added these lines to the beginning
location = / {
return 301 https://$server_name/mail;
}