git.iko.soy/typeable/oauth2-proxy
on master help sign in
README: fix nginx auth_request example for requests with body

Nginx never sends the body with the auth_request sub-request, but keeps the original Content-Length header by default. Without some config tweaks, this results in the request to /oauth2/auth hanging.

commit20e87edde8b2b79bfa042bdcc7952604e65e1055 authorPierce Lopez <pierce.lopez@gmail.com> dateMon 18 Dec 2017, 20:55 (9 years ago) parentd75f626
1 file changed+9
README.md+9
README.md+9
@@ -387,6 +387,15 @@ server {
387387 proxy_set_header X-Scheme $scheme;
388388 proxy_set_header X-Auth-Request-Redirect $request_uri;
389389 }
390+ location = /oauth2/auth {
391+ proxy_pass http://127.0.0.1:4180;
392+ proxy_set_header Host $host;
393+ proxy_set_header X-Real-IP $remote_addr;
394+ proxy_set_header X-Scheme $scheme;
395+ # nginx auth_request includes headers but not body
396+ proxy_set_header Content-Length "";
397+ proxy_pass_request_body off;
398+ }
390399
391400 location / {
392401 auth_request /oauth2/auth;