ctucx.git: nixfiles

ctucx' nixfiles

commit d5c969242a2069b1d02fe8055ab75f85475f6267
parent ee35e9977f99fca6c938bc8c50fb0ce309a0976d
Author: Leah (ctucx) <leah@ctu.cx>
Date: Wed, 14 Sep 2022 14:35:41 +0200

machines/lollo/gotosocial: redirect `/` to `/@leah`
1 file changed, 13 insertions(+), 10 deletions(-)
M
machines/lollo/gotosocial.nix
|
23
+++++++++++++----------
diff --git a/machines/lollo/gotosocial.nix b/machines/lollo/gotosocial.nix
@@ -44,16 +44,19 @@
   services.nginx.virtualHosts."fedi.home.ctu.cx" = {
     enableACME = true;
     forceSSL   = true;
-    locations."/.well-known/host-meta".extraConfig = ''return 200 '<?xml version="1.0" encoding="UTF-8"?><XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0"><Link rel="lrdd" template="https://fedi.home.ctu.cx/.well-known/webfinger?resource={uri}" type="application/xrd+xml" /></XRD>';'';
-    locations."/".extraConfig  = ''
-      proxy_pass http://localhost:8085/;
-
-      proxy_set_header Host $host;
-      proxy_set_header Upgrade $http_upgrade;
-      proxy_set_header Connection "upgrade";
-      proxy_set_header X-Forwarded-For $remote_addr;
-      proxy_set_header X-Forwarded-Proto $scheme;
-    '';
+    locations  = {
+      "/.well-known/host-meta".extraConfig = ''return 200 '<?xml version="1.0" encoding="UTF-8"?><XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0"><Link rel="lrdd" template="https://fedi.home.ctu.cx/.well-known/webfinger?resource={uri}" type="application/xrd+xml" /></XRD>';'';
+      "= /".return    = "307 /@leah";
+      "/".extraConfig = ''
+        proxy_pass http://localhost:8085/;
+
+        proxy_set_header Host $host;
+        proxy_set_header Upgrade $http_upgrade;
+        proxy_set_header Connection "upgrade";
+        proxy_set_header X-Forwarded-For $remote_addr;
+        proxy_set_header X-Forwarded-Proto $scheme;
+      '';
+    };
   };
 
 }