Update nginx.nix
Some checks failed
Deploy NixOS / deploy (push) Failing after 18s

This commit is contained in:
2026-02-17 15:34:01 -07:00
parent 08b69bb46a
commit 93ccefc77c

View File

@@ -34,19 +34,24 @@ let
websockets ? false, websockets ? false,
extraConfig ? "", extraConfig ? "",
locationExtraConfig ? "", locationExtraConfig ? "",
extraLocations ? { },
}: }:
{ {
"${host}" = { "${host}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
extraConfig = extraConfig; extraConfig = extraConfig;
locations."/" = {
locations = {
"/" = {
proxyPass = upstream; proxyPass = upstream;
proxyWebsockets = websockets; proxyWebsockets = websockets;
extraConfig = lib.concatStringsSep "\n" ( extraConfig = lib.concatStringsSep "\n" (
[ blockAi ] ++ lib.optional (locationExtraConfig != "") locationExtraConfig [ blockAi ] ++ lib.optional (locationExtraConfig != "") locationExtraConfig
); );
}; };
}
// extraLocations;
}; };
}; };
@@ -130,19 +135,24 @@ in
(mkProxyVhost { (mkProxyVhost {
host = rootDomain; host = rootDomain;
upstream = "http://lloyd.tadpole-pain.ts.net:3000"; upstream = "http://lloyd.tadpole-pain.ts.net:3000";
})
{ extraLocations = {
"${rootDomain}".locations."= /.well-known/matrix/server".extraConfig = '' "= /.well-known/matrix/server" = {
extraConfig = ''
default_type application/json; default_type application/json;
return 200 '${wellKnownServer}'; return 200 '${wellKnownServer}';
''; '';
"${rootDomain}".locations."= /.well-known/matrix/client".extraConfig = '' };
"= /.well-known/matrix/client" = {
extraConfig = ''
default_type application/json; default_type application/json;
add_header Access-Control-Allow-Origin "*"; add_header Access-Control-Allow-Origin "*";
return 200 '${wellKnownClient}'; return 200 '${wellKnownClient}';
''; '';
} };
};
})
(mkProxyVhost { (mkProxyVhost {
host = "analytics.${rootDomain}"; host = "analytics.${rootDomain}";
@@ -286,6 +296,7 @@ in
"${matrixRtcDomain}" = { "${matrixRtcDomain}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {
proxyPass = "http://[::1]:${toString config.services.livekit.settings.port}"; proxyPass = "http://[::1]:${toString config.services.livekit.settings.port}";
proxyWebsockets = true; proxyWebsockets = true;