websocket support

This commit is contained in:
Danilo Reyes 2025-03-17 20:05:11 -06:00
parent 9297fbd655
commit 75efcec006

View File

@ -44,6 +44,10 @@ let
type = lib.types.bool;
default = "${config.my.servers.${name}.hostName}" == config.my.mainServer;
};
enableSocket = lib.mkOption {
type = lib.types.bool;
default = false;
};
};
proxy = locations: {
inherit locations;
@ -51,7 +55,14 @@ let
enableACME = true;
http2 = true;
};
proxyReverse = cfg: proxy { "/".proxyPass = "http://${cfg.ip}:${toString cfg.port}/"; };
proxyReverse =
cfg:
proxy {
"/" = {
proxyPass = "http://${cfg.ip}:${toString cfg.port}/";
proxyWebsockets = cfg.enableSocket;
};
};
proxyReverseFix =
cfg:
let