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