fix double location "/"

merge-requests/27/head
Lzebulon 2025-08-02 18:35:54 +02:00
parent 89f9038adf
commit eb806aa9fb
No known key found for this signature in database
GPG Key ID: D6CDAB8050CBBE7D
1 changed files with 9 additions and 5 deletions

View File

@ -143,8 +143,10 @@ in
vhostName: vhostConfig: {
locations = mkIf ((substring 0 1 vhostConfig.target) != "/") {
"/favicon.ico".root = "/var/www/logo/";
"/".proxyPass = "http://${vhostConfig.target}";
"/".proxyWebsockets = vhostConfig.proxyWebsockets;
"/" = {
proxyPass = "http://${vhostConfig.target}";
proxyWebsockets = vhostConfig.proxyWebsockets;
};
};
root = mkIf ((substring 0 1 vhostConfig.target) == "/") vhostConfig.target;
listen = [
@ -167,7 +169,7 @@ in
"${vhostName}.crans.eu"
] ++ map (value: value.name + "." + value.domaine) aliases;
globalRedirect = "${vhostName}.crans.org";
locations."/".proxyWebsockets = vhostConfig.proxyWebsockets;
# locations."/".proxyWebsockets = vhostConfig.proxyWebsockets;
}
) cfg.virtualHosts;
anubisConfig = mapAttrs' (
@ -175,8 +177,10 @@ in
enableACME = !vhostConfig.httpOnly;
forceSSL = !vhostConfig.httpOnly;
rejectSSL = vhostConfig.httpOnly;
locations."/".proxyPass = "http://unix:/run/anubis/anubis-${vhostName}.sock";
locations."/".proxyWebsockets = vhostConfig.proxyWebsockets;
locations."/" = {
proxyPass = "http://unix:/run/anubis/anubis-${vhostName}.sock";
proxyWebsockets = vhostConfig.proxyWebsockets;
};
serverName = "${vhostName}.crans.org";
}
) cfg.virtualHosts;