Move set x-auth-username to locations

This commit is contained in:
bluepython508
2023-11-10 17:06:59 +00:00
parent e58fe69747
commit cf9cb3eff5

View File

@@ -47,10 +47,14 @@
};
options.services.nginx.virtualHosts = lib.mkOption {
type = lib.types.attrsOf (lib.types.submodule ({ config, ...}: {
options.locations = lib.types.attrsOf (lib.types.submodule {
extraConfig = lib.mkIf config.sso.enable ''
proxy_set_header X-Auth-Username $auth_resp_username
'';
})
options.sso.enable = lib.mkEnableOption "SSO BSN";
config.extraConfig = lib.mkIf config.sso.enable ''
auth_request /__auth_sso_validate;
proxy_set_header X-Auth-Username $auth_resp_username;
location = /__auth_sso_validate {
internal;