From 4af5fb4bcbe974e6dd726d330fd1b64e123a0a7d Mon Sep 17 00:00:00 2001 From: Lgmrszd Date: Tue, 16 Jan 2024 22:30:42 +0300 Subject: [PATCH] handling of unknown subdomains --- hosts/vps1/configuration.nix | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hosts/vps1/configuration.nix b/hosts/vps1/configuration.nix index 79a3bb9..b42f04f 100644 --- a/hosts/vps1/configuration.nix +++ b/hosts/vps1/configuration.nix @@ -2,7 +2,7 @@ let rootDomain = "lgmrszd.xyz"; gtnhDomain = "gtnh.${rootDomain}"; - discDomain = "discource.testdrive.${rootDomain}"; + discDomain = "discourse.testdrive.${rootDomain}"; akkoDomain = "akko.testdrive.${rootDomain}"; iceDomain = "ice.testdrive.${rootDomain}"; in @@ -39,10 +39,16 @@ in services.nginx = { enable = true; - virtualHosts.${rootDomain} = { - # addSSL = true; - forceSSL = true; + virtualHosts."${rootDomain}80" = { + serverName = rootDomain; + rejectSSL = true; default = true; + locations."/" = { + return = "301 https://${rootDomain}$request_uri"; + }; + }; + virtualHosts.${rootDomain} = { + onlySSL = true; enableACME = true; root = "/var/www/todo"; };