add proxyWebsockets option

main^2
Lzebulon 2025-08-02 18:21:07 +02:00
parent 0297fbc472
commit 4d021eedff
No known key found for this signature in database
GPG Key ID: D6CDAB8050CBBE7D
2 changed files with 13 additions and 0 deletions

View File

@ -155,6 +155,7 @@ in {
virtualHosts = {
"collabora" = {
target = "172.16.10.149";
proxyWebsockets = true;
};
"eclat" = {
anubisConfig = "${anubisMirror}";

View File

@ -75,6 +75,15 @@ in
'';
example = "true";
};
proxyWebSockets = mkOption {
type = types.bool;
default = false;
description = ''
Activer les websockets
'';
example = "true";
};
};
}
);
@ -135,6 +144,7 @@ in
locations = mkIf ((substring 0 1 vhostConfig.target) != "/") {
"/favicon.ico".root = "/var/www/logo/";
"/".proxyPass = "http://${vhostConfig.target}";
"/".proxyWebsockets = vhostConfig.proxyWebsockets;
};
root = mkIf ((substring 0 1 vhostConfig.target) == "/") vhostConfig.target;
listen = [
@ -157,6 +167,7 @@ in
"${vhostName}.crans.eu"
] ++ map (value: value.name + "." + value.domaine) aliases;
globalRedirect = "${vhostName}.crans.org";
locations."/".proxyWebsockets = vhostConfig.proxyWebsockets;
}
) cfg.virtualHosts;
anubisConfig = mapAttrs' (
@ -165,6 +176,7 @@ in
forceSSL = !vhostConfig.httpOnly;
rejectSSL = vhostConfig.httpOnly;
locations."/".proxyPass = "http://unix:/run/anubis/anubis-${vhostName}.sock";
locations."/".proxyWebsockets = vhostConfig.proxyWebsockets;
serverName = "${vhostName}.crans.org";
}
) cfg.virtualHosts;