fix nginx auth-proxy configuration to forward request bodies
Move proxy_pass directive to correct position in nginx location block and update proxy settings: enable request body forwarding (proxy_pass_request_body on) and pass original Content-Length header (from $content_length variable) instead of stripping it, ensuring auth-proxy receives full request payloads.
This commit is contained in:
@@ -37,17 +37,19 @@ docker-compose up -d
|
|||||||
# spoofed. If you need a CDN, configure the realip module instead
|
# spoofed. If you need a CDN, configure the realip module instead
|
||||||
# of trusting the header.
|
# of trusting the header.
|
||||||
|
|
||||||
|
location = /_auth_proxy {
|
||||||
location = /_auth_proxy {
|
location = /_auth_proxy {
|
||||||
internal;
|
internal;
|
||||||
|
|
||||||
proxy_pass http://auth-proxy:8080/auth;
|
proxy_pass_request_body on;
|
||||||
|
proxy_set_header Content-Length $content_length;
|
||||||
proxy_pass_request_body off;
|
|
||||||
proxy_set_header Content-Length "";
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Original-Host $host;
|
proxy_set_header X-Original-Host $host;
|
||||||
proxy_set_header X-Original-URI $request_uri;
|
proxy_set_header X-Original-URI $request_uri;
|
||||||
proxy_set_header Authorization $http_authorization;
|
proxy_set_header Authorization $http_authorization;
|
||||||
|
|
||||||
|
proxy_pass http://auth-proxy:8080/auth;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user