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;
}