This commit is contained in:
Till 2025-12-15 18:19:39 +01:00
parent ad5ba0eb46
commit d564bd5d0f
3 changed files with 11 additions and 1 deletions

View file

@ -11,6 +11,7 @@
recommendedTlsSettings = true; recommendedTlsSettings = true;
virtualHosts = { virtualHosts = {
"${config.networking.domain}" = { "${config.networking.domain}" = {
onlySSL = true; onlySSL = true;
useACMEHost = config.networking.domain; useACMEHost = config.networking.domain;
@ -21,6 +22,7 @@
''; '';
}; };
}; };
"${config.networking.fqdn}-80" = { "${config.networking.fqdn}-80" = {
serverAliases = [ serverAliases = [
"*.ktiu.net" "*.ktiu.net"
@ -33,6 +35,7 @@
return = "301 https://$host$request_uri"; return = "301 https://$host$request_uri";
}; };
}; };
"${config.networking.fqdn}" = { "${config.networking.fqdn}" = {
onlySSL = true; onlySSL = true;
useACMEHost = config.networking.domain; useACMEHost = config.networking.domain;
@ -40,6 +43,7 @@
return = "404"; return = "404";
}; };
}; };
}; };
}; };

View file

@ -14,7 +14,7 @@ in
]; ];
services.nginx.virtualHosts."${srv.DOMAIN}" = { services.nginx.virtualHosts."${srv.DOMAIN}" = {
forceSSL = true; onlySSL = true;
useACMEHost = config.networking.domain; useACMEHost = config.networking.domain;
locations."/".proxyPass = "http://localhost:${toString srv.HTTP_PORT}"; locations."/".proxyPass = "http://localhost:${toString srv.HTTP_PORT}";
extraConfig = '' extraConfig = ''

View file

@ -7,4 +7,10 @@
./dovecot.nix ./dovecot.nix
./roundcube.nix ./roundcube.nix
]; ];
security.acme.certs."${config.networking.domain}".reloadServices = [
"nginx"
"dovecot2"
"postfix"
];
} }