deis / router

Edge router for Deis Workflow
https://deis.com
MIT License
80 stars 57 forks source link

need annotation for nginx proxy_buffer_size #293

Closed jshimko closed 7 years ago

jshimko commented 7 years ago

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 7 years ago

@jshimko we'd accept a PR if you're up for it.

gemoya commented 7 years ago

Do you have a expected relase date with this changes??

jshimko commented 7 years ago

Thanks again @krancour!

krancour commented 7 years ago

No problem, @jshimko.

vdice commented 7 years ago

@gemoya these changes are now included in the latest Router release, v2.11.0. Testing will commence shortly for the next Workflow release to include this version (Workflow v2.12) and we expect it will be available by tomorrow.