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:
db123-test
2026-05-04 16:08:11 +03:30
parent 5a811241e1
commit 3ab34aeea7

View File

@@ -37,17 +37,19 @@ docker-compose up -d
# spoofed. If you need a CDN, configure the realip module instead
# of trusting the header.
location = /_auth_proxy {
location = /_auth_proxy {
internal;
proxy_pass http://auth-proxy:8080/auth;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_pass_request_body on;
proxy_set_header Content-Length $content_length;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Original-Host $host;
proxy_set_header X-Original-URI $request_uri;
proxy_set_header Authorization $http_authorization;
proxy_pass http://auth-proxy:8080/auth;
}
}
```