From 00b702052c4cc0f12cee39df85c5ee597adbf2a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 14 May 2025 15:46:40 +0200 Subject: [PATCH] fix: routes --- machines/moritz-server/reverse-proxy.nix | 25 +++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/machines/moritz-server/reverse-proxy.nix b/machines/moritz-server/reverse-proxy.nix index 7b09040..e01b3f8 100644 --- a/machines/moritz-server/reverse-proxy.nix +++ b/machines/moritz-server/reverse-proxy.nix @@ -54,19 +54,11 @@ enable = true; recommendedProxySettings = true; virtualHosts = { - "moritzboeh.me" = { - serverAliases = ["*.moritzboeh.me"]; + ".moritzboeh.me" = { locations."/" = { proxyPass = "http://192.168.0.6"; }; }; - "moritz.foo" = { - forceSSL = true; - useACMEHost = "moritz.foo"; - locations."/" = { - return = "301 https://www.moritz.foo"; - }; - }; "www.moritz.foo" = { forceSSL = true; useACMEHost = "any.moritz.foo"; @@ -77,6 +69,21 @@ return = "200 'Hello World'"; }; }; + "moritz.foo" = { + forceSSL = true; + useACMEHost = "moritz.foo"; + locations."/" = { + return = "301 https://www.moritz.foo"; + }; + }; + "_" = { + forceSSL = true; + default = true; + useACMEHost = "any.moritz.foo"; + locations."/" = { + return = "404 'Not found!'"; + }; + }; }; streamConfig = '' upstream diskstation {