diff --git a/nginx.conf b/nginx.conf index a0ff4cc..a7ca18b 100644 --- a/nginx.conf +++ b/nginx.conf @@ -33,7 +33,7 @@ http { proxy_set_header X-WEBAUTH-USER $xWebauthUser; # redirect 401 and 403 to login form - error_page 401 403 =200 /login; + error_page 401 403 /login; proxy_pass http://backend/; } @@ -42,6 +42,7 @@ http { proxy_pass http://authenticator/login; proxy_set_header Host $host:$server_port; proxy_set_header X-Original-URI $request_uri; + proxy_set_header X-Real-IP $remote_addr; } location /auth-proxy { @@ -52,11 +53,14 @@ http { proxy_pass http://authenticator/; proxy_pass_request_body off; - proxy_set_header Host $host:$server_port; proxy_set_header Content-Length ""; + + proxy_set_header X-Real-IP $remote_addr; + # Login service returns a redirect to the original URI # and sets the cookie for the authenticator proxy_set_header X-Original-URI $request_uri; + proxy_set_header Host $host:$server_port; } } }