redirect browsers to main page if connecting to mail server vhost
This commit is contained in:
parent
798e10bb07
commit
29b14ef74e
1 changed files with 12 additions and 0 deletions
12
email.nix
12
email.nix
|
@ -26,4 +26,16 @@ in {
|
||||||
certificateFile = "/var/lib/acme/${root_host}/fullchain.pem";
|
certificateFile = "/var/lib/acme/${root_host}/fullchain.pem";
|
||||||
keyFile = "/var/lib/acme/${root_host}/key.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}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue