diff --git a/modules/server/nginx.nix b/modules/server/nginx.nix index a64ec1f..97470cd 100644 --- a/modules/server/nginx.nix +++ b/modules/server/nginx.nix @@ -17,16 +17,25 @@ with lib; { recommendedTlsSettings = true; }; networking.firewall.allowedTCPPorts = [80 443]; - services.nginx.virtualHosts."localhost" = { - addSSL = false; - enableACME = false; - root = "/var/www/localhost"; - default = true; - }; - services.nginx.virtualHosts."ellmauthaler.net" = { - addSSL = true; - enableACME = true; - root = "/var/www/localhost"; + services.nginx.virtualHosts = { + "localhost" = { + addSSL = false; + enableACME = false; + root = "/var/www/localhost"; + default = true; + }; + + "ellmauthaler.net" = { + addSSL = true; + enableACME = true; + root = "/var/www/localhost"; + }; + + "www.ellmauthaler.net" = { + enableACME = true; + forceSSL = true; + globalRedirect = "stefan.ellmauthaler.net"; + }; }; }; }