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

View File

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