Small reverseproxy fixes

reverseproxy
Pyjacpp 2026-07-06 11:52:33 +02:00
parent 4e83b11d22
commit 0af3d1071c
No known key found for this signature in database
GPG Key ID: ED479A5A26930939
2 changed files with 11 additions and 17 deletions

View File

@ -176,10 +176,7 @@ in
httpOnly = true;
proxyPass = "172.16.10.104";
};
"nekorale" = {
anubisConfig = "${anubisAllowOther}";
globalRedirect = "172.16.10.31/club-nekorale";
};
"nekorale".globalRedirect = "172.16.10.31/club-nekorale";
"perso" = {
anubisConfig = "${anubisPerso}";
proxyPass = "172.16.10.31";
@ -187,10 +184,7 @@ in
"clubs"
];
};
"snl" = {
anubisConfig = "${anubisAllowOther}";
globalRedirect = "172.16.10.31/sonetlumens";
};
"snl".globalRedirect = "172.16.10.31/sonetlumens";
"wiki" = {
anubisConfig = "${anubisChallenge}";
proxyPass = "172.16.10.161";

View File

@ -66,8 +66,8 @@ in
};
proxyPass = mkOption {
type = types.str;
default = "";
type = types.nullOr types.str;
default = null;
description = ''
Indique la destination à proxy.
'';
@ -75,7 +75,7 @@ in
};
serveLocalFiles = mkOption {
type = types.nullOr types.str;
type = types.nullOr types.path;
default = null;
description = ''
Chemin vers un dossier à exposer statiquement.
@ -232,7 +232,7 @@ in
# Configuration du service à proxy.
"${vhostName}" = vhostExtraConf // {
serverName = "${vhostName}.crans.${mainTld}";
locations."/" = mkIf (vhostConfig.proxyPass != "") {
locations."/" = mkIf (vhostConfig.proxyPass != null) {
proxyPass = "http://${vhostConfig.proxyPass}";
proxyWebsockets = vhostConfig.proxyWebsockets;
};
@ -242,16 +242,16 @@ in
# Entrée dAnubis
"${vhostName}-anubis" = mkIf (vhostConfig.anubisConfig != null) entryExtraConf // {
serverName = "${vhostName}.crans.${mainTld}";
locations."/" = {
proxyPass = "http://unix:/run/anubis/anubis-${vhostName}/socket.sock";
proxyWebsockets = vhostConfig.proxyWebsockets;
};
extraConfig = entryExtraConf.extraConfig + ''
access_log /var/log/nginx/anubis.access.log;
error_log /var/log/nginx/anubis.error.log;
'';
};
serverName = "${vhostName}.crans.${mainTld}";
};
}
# Les alias
// lib.mergeAttrsList (