diff --git a/hosts/vm/reverseproxy/reverseproxy.nix b/hosts/vm/reverseproxy/reverseproxy.nix index e154c2c..5c09e66 100644 --- a/hosts/vm/reverseproxy/reverseproxy.nix +++ b/hosts/vm/reverseproxy/reverseproxy.nix @@ -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"; diff --git a/modules/services/reverseproxy.nix b/modules/services/reverseproxy.nix index ed386a7..57c9486 100644 --- a/modules/services/reverseproxy.nix +++ b/modules/services/reverseproxy.nix @@ -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,15 +242,15 @@ in # Entrée d’Anubis "${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}"; + extraConfig = entryExtraConf.extraConfig + '' + access_log /var/log/nginx/anubis.access.log; + error_log /var/log/nginx/anubis.error.log; + ''; }; } # Les alias