need annotation for nginx proxy_buffer_size
jshimko opened this issue · 5 comments
jshimko commented
If an upstream app has a header that's bigger than the default proxy buffer size, nginx returns a 502 and the client receives nothing.
Example logs...
2016/11/29 18:10:10 [error] 64#0: *59606 upstream sent too big header while reading response header from upstream, client: 100.96.2.1, server: ~^subdomain\.(?<domain>.+)$, request: "GET / HTTP/1.1", upstream: "http://101.69.46.220:80/", host: "subdomain.example.com"
[2016-11-29T18:10:10+00:00] - 100.96.2.1 - - - 502 - "GET / HTTP/1.1" - 732 - "-" - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2936.0 Safari/537.36" - "~^subdomain\x5C.(?<domain>.+)$" - 101.69.46.220:80 - subdomain.example.com - 0.005 - 0.005
The explanation/fix...
https://ma.ttias.be/nginx-proxy-upstream-sent-big-header-reading-response-header-upstream/
So, essentially just need to be able to add those proxy buffer lines to the config...
server {
listen 80;
server_name host.tld;
location / {
proxy_pass http://upstream;
...
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
}
}
Reference:
http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffer_size
bacongobbler commented
@jshimko we'd accept a PR if you're up for it.
gemoya commented
Do you have a expected relase date with this changes??