nixos: services: migrate to 'websocketsLocations'

This commit is contained in:
Bruno BELANYI 2024-11-19 15:49:31 +00:00
parent e9d96138d5
commit 6a1a35a384
5 changed files with 8 additions and 28 deletions

View file

@ -65,9 +65,7 @@ in
aria-rpc = { aria-rpc = {
port = cfg.rpcPort; port = cfg.rpcPort;
# Proxy websockets for RPC # Proxy websockets for RPC
extraConfig = { websocketsLocations = [ "/" ];
locations."/".proxyWebsockets = true;
};
}; };
}; };

View file

@ -30,9 +30,7 @@ in
audiobookshelf = { audiobookshelf = {
inherit (cfg) port; inherit (cfg) port;
# Proxy websockets for RPC # Proxy websockets for RPC
extraConfig = { websocketsLocations = [ "/" ];
locations."/".proxyWebsockets = true;
};
}; };
}; };

View file

@ -27,17 +27,13 @@ in
my.services.nginx.virtualHosts = { my.services.nginx.virtualHosts = {
jellyfin = { jellyfin = {
port = 8096; port = 8096;
websocketsLocations = [ "/socket" ];
extraConfig = { extraConfig = {
locations."/" = { locations."/" = {
extraConfig = '' extraConfig = ''
proxy_buffering off; proxy_buffering off;
''; '';
}; };
# Too bad for the repetition...
locations."/socket" = {
proxyPass = "http://127.0.0.1:8096/";
proxyWebsockets = true;
};
}; };
}; };
}; };

View file

@ -40,18 +40,10 @@ in
my.services.nginx.virtualHosts = { my.services.nginx.virtualHosts = {
collabora = { collabora = {
inherit (cfg) port; inherit (cfg) port;
websocketsLocations = [
extraConfig = { "~ ^/cool/(.*)/ws$"
# Too bad for the repetition... "^~ /cool/adminws"
locations."~ ^/cool/(.*)/ws$" = { ];
proxyPass = "http://127.0.0.1:${builtins.toString cfg.port}";
proxyWebsockets = true;
};
locations."^~ /cool/adminws" = {
proxyPass = "http://127.0.0.1:${builtins.toString cfg.port}";
proxyWebsockets = true;
};
};
}; };
}; };
}; };

View file

@ -152,11 +152,7 @@ in
sso = { sso = {
enable = true; enable = true;
}; };
websocketsLocations = [ "/" ];
# Enable websockets on root
extraConfig = {
locations."/".proxyWebsockets = true;
};
}; };
}; };