From 20e87edde8b2b79bfa042bdcc7952604e65e1055 Mon Sep 17 00:00:00 2001 From: Pierce Lopez Date: Mon, 18 Dec 2017 20:55:37 -0500 Subject: [PATCH] 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. --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index daeaff0..178a8e8 100644 --- a/README.md +++ b/README.md @@ -387,6 +387,15 @@ server { proxy_set_header X-Scheme $scheme; proxy_set_header X-Auth-Request-Redirect $request_uri; } + location = /oauth2/auth { + proxy_pass http://127.0.0.1:4180; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Scheme $scheme; + # nginx auth_request includes headers but not body + proxy_set_header Content-Length ""; + proxy_pass_request_body off; + } location / { auth_request /oauth2/auth;