Skip to content

Commit

Permalink
Returning 401 and 403 status codes instead of 200 for redirect to login
Browse files Browse the repository at this point in the history
  • Loading branch information
Siecje committed May 1, 2017
1 parent 07e2fdd commit b0dcbbc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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/;
}
Expand All @@ -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 {
Expand All @@ -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;
}
}
}

0 comments on commit b0dcbbc

Please sign in to comment.