diff --git a/root/defaults/nginx/authelia-server.conf.sample b/root/defaults/nginx/authelia-server.conf.sample index d969a05..f53a278 100644 --- a/root/defaults/nginx/authelia-server.conf.sample +++ b/root/defaults/nginx/authelia-server.conf.sample @@ -28,7 +28,7 @@ location @authelia_proxy_signin { add_header Set-Cookie $set_cookie; ## Set the $target_url variable based on the original request - set_escape_uri $target_url $scheme://$http_host$request_uri; + set_escape_uri $target_url $scheme://$host:$server_port$request_uri; ## Translate the Location response header from the auth subrequest into a variable auth_request_set $signin_url $upstream_http_location; diff --git a/root/defaults/nginx/authentik-server.conf.sample b/root/defaults/nginx/authentik-server.conf.sample index 7b08ff9..bb879b8 100644 --- a/root/defaults/nginx/authentik-server.conf.sample +++ b/root/defaults/nginx/authentik-server.conf.sample @@ -38,10 +38,10 @@ location @goauthentik_proxy_signin { add_header Set-Cookie $set_cookie; ## Set the $target_url variable based on the original request - set_escape_uri $target_url $scheme://$http_host$request_uri; + set_escape_uri $target_url $scheme://$host:$server_port$request_uri; ## Set the $signin_url variable - set $signin_url https://$http_host/outpost.goauthentik.io/start?rd=$target_url; + set $signin_url https://$host:$server_port/outpost.goauthentik.io/start?rd=$target_url; ## Redirect to login return 302 $signin_url; diff --git a/root/defaults/nginx/proxy.conf.sample b/root/defaults/nginx/proxy.conf.sample index 967d170..38ec26e 100644 --- a/root/defaults/nginx/proxy.conf.sample +++ b/root/defaults/nginx/proxy.conf.sample @@ -33,5 +33,5 @@ proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-Ssl on; proxy_set_header X-Forwarded-Uri $request_uri; proxy_set_header X-Original-Method $request_method; -proxy_set_header X-Original-URL $scheme://$http_host$request_uri; +proxy_set_header X-Original-URL $scheme://$host:$server_port$request_uri; proxy_set_header X-Real-IP $remote_addr; diff --git a/root/defaults/nginx/tinyauth-server.conf.sample b/root/defaults/nginx/tinyauth-server.conf.sample index a4256c8..a19e371 100644 --- a/root/defaults/nginx/tinyauth-server.conf.sample +++ b/root/defaults/nginx/tinyauth-server.conf.sample @@ -12,7 +12,7 @@ location /tinyauth { proxy_pass http://$upstream_tinyauth:3000/api/auth/nginx; proxy_set_header x-forwarded-proto $scheme; - proxy_set_header x-forwarded-host $http_host; + proxy_set_header x-forwarded-host $host:$server_port; proxy_set_header x-forwarded-uri $request_uri; } @@ -21,8 +21,8 @@ location @tinyauth_login { internal; ## Set the $target_url variable based on the original request - set_escape_uri $target_url $scheme://$http_host$request_uri; - + set_escape_uri $target_url $scheme://$host:$server_port$request_uri; + ## Set the $signin_url variable set $domain $host; if ($host ~* "^[^.]+\.([^.]+\..+)$") {