diff --git a/modules/nixos/server/lemmy.nix b/modules/nixos/server/lemmy.nix index dc50e3c..d8c7fe9 100644 --- a/modules/nixos/server/lemmy.nix +++ b/modules/nixos/server/lemmy.nix @@ -42,46 +42,46 @@ in { address = "0.0.0.0"; }; - services.nginx.virtualHosts."${hostname}" = let - ui = "http://10.0.0.3:${toString port-ui}"; - backend = "http://10.0.0.3:${toString port}"; - in lib.mkIf config.mods.server.nginx.enable { - forceSSL = true; - enableACME = true; - locations = { - "~ ^/(api|pictrs|feeds|nodeinfo|.well-known)" = { - # backend requests - proxyPass = backend; - proxyWebsockets = true; - recommendedProxySettings = true; - }; - "/" = { - # mixed frontend and backend requests, based on the request headers - extraConfig = '' - set $proxpass "${ui}"; - if ($http_accept = "application/activity+json") { - set $proxpass "${backend}"; - } - if ($http_accept = "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"") { - set $proxpass "${backend}"; - } - if ($request_method = POST) { - set $proxpass "${backend}"; - } + # services.nginx.virtualHosts."${hostname}" = let + # ui = "http://10.0.0.3:${toString port-ui}"; + # backend = "http://10.0.0.3:${toString port}"; + # in lib.mkIf config.mods.server.nginx.enable { + # forceSSL = true; + # enableACME = true; + # locations = { + # "~ ^/(api|pictrs|feeds|nodeinfo|.well-known)" = { + # # backend requests + # proxyPass = backend; + # proxyWebsockets = true; + # recommendedProxySettings = true; + # }; + # "/" = { + # # mixed frontend and backend requests, based on the request headers + # extraConfig = '' + # set $proxpass "${ui}"; + # if ($http_accept = "application/activity+json") { + # set $proxpass "${backend}"; + # } + # if ($http_accept = "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"") { + # set $proxpass "${backend}"; + # } + # if ($request_method = POST) { + # set $proxpass "${backend}"; + # } - # Cuts off the trailing slash on URLs to make them valid - rewrite ^(.+)/+$ $1 permanent; + # # Cuts off the trailing slash on URLs to make them valid + # rewrite ^(.+)/+$ $1 permanent; - proxy_pass $proxpass; - # Proxied `Host` header is required to validate ActivityPub HTTP signatures for incoming events. - # The other headers are optional, for the sake of better log data. - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - ''; - }; - }; - }; + # proxy_pass $proxpass; + # # Proxied `Host` header is required to validate ActivityPub HTTP signatures for incoming events. + # # The other headers are optional, for the sake of better log data. + # proxy_set_header X-Real-IP $remote_addr; + # proxy_set_header Host $host; + # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # ''; + # }; + # }; + # }; }; }