diff options
| author | Grigory Shipunov | 2025-01-21 00:16:31 +0000 |
|---|---|---|
| committer | Grigory Shipunov | 2025-01-21 00:16:37 +0000 |
| commit | 5bbfdddaaa586cd6d5b20ea5b6c36d8867fa3d08 (patch) | |
| tree | fac9de30e0038a098a1ba80e10e979302ade13a0 /hosts/cloud/proxy/auth.nix | |
| parent | 3a98bf89b6cc3ddd285501258c2c74c9377c3e19 (diff) | |
proxy authentik and dav with sso
Diffstat (limited to 'hosts/cloud/proxy/auth.nix')
| -rw-r--r-- | hosts/cloud/proxy/auth.nix | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/hosts/cloud/proxy/auth.nix b/hosts/cloud/proxy/auth.nix index b8e10d5..6aa22e3 100644 --- a/hosts/cloud/proxy/auth.nix +++ b/hosts/cloud/proxy/auth.nix @@ -1,23 +1,35 @@ { ... }: { - services.nginx.upstreams.keycloak = { + services.nginx.upstreams.authentik = { servers = { - "10.89.88.11:38080" = { }; - "[fd31:185d:722f::11]:38080" = { }; + "10.89.88.11:9000" = { }; + "[fd31:185d:722f::11]:9000" = { }; }; + extraConfig = '' + keepalive 10; + ''; }; services.nginx.virtualHosts."auth.oxapentane.com" = { forceSSL = true; enableACME = true; locations."/" = { - proxyPass = "http://keycloak"; + proxyPass = "http://authentik"; extraConfig = '' - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-Port 433; + # general proxy settings + proxy_connect_timeout 60s; + proxy_send_timeout 60s; + proxy_read_timeout 60s; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Server $host; + # authentik specifik + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade_keepalive; ''; }; }; |
