redirect browsers to main page if connecting to mail server vhost

This commit is contained in:
Grimmauld 2023-12-29 09:41:25 +00:00
parent 798e10bb07
commit 29b14ef74e

View file

@ -26,4 +26,16 @@ in {
certificateFile = "/var/lib/acme/${root_host}/fullchain.pem";
keyFile = "/var/lib/acme/${root_host}/key.pem";
};
services.nginx = {
enable = true;
virtualHosts."${mail_host}" = { # you should NOT be here from a browser :P
serverName = mail_host;
forceSSL = true;
useACMEHost = root_host;
locations."/" = {
return = "307 https://${root_host}";
};
};
};
}