0

I've got a Docker NGINX host serving static web pages, and proxying to a Docker uWSGI backend. After a couple errors, I start getting 500s from the website. Looking at the NGINX logs, I see:

nwm-nginx-1 | 2016-05-04T10:19:07.911553394Z 2016/05/04 10:19:07 [error]
  9#9: *480 upstream sent too big header while reading response header
  from upstream, client: 50.x.x.x, server: , request: "GET /api/data
  HTTP/1.1", upstream: "uwsgi://10.7.0.6:80", host: "server.com", 
  referrer: "https://server.com/"
nwm-nginx-1 | 2016-05-04T10:19:07.911675201Z 50.164.254.84 - - 
  [04/May/2016:10:19:07 +0000] "GET /api/data HTTP/1.1" 502 575 
  "https://server.com/" "Mozilla/5.0 (Windows NT 6.1; WOW64) 
  AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.94
  Safari/537.36" "-"

And in the uWSGI logs:

nwm-api-1 | 2016-05-04T10:19:07.870083229Z [pid: 10|app: 0|req: 97/198]
  50.164.254.84 () {48 vars in 799 bytes} [Wed May  4 06:19:07 2016] 
  POST /api/login => generated 488 bytes in 81 msecs (HTTP/1.1 200) 
  3 headers in 436 bytes (1 switches on core 0)
nwm-api-1 | 2016-05-04T10:19:07.911716856Z Wed May  4 06:19:07 2016 - 
  uwsgi_response_write_body_do(): Connection reset by peer 
  [core/writer.c line 331] during GET /api/data (50.164.254.84)
nwm-api-1 | 2016-05-04T10:19:07.911811097Z IOError: write error

This is my NGINX config:

gzip on;
gzip_min_length 1000;
gzip_proxied any;
gzip_types text/css application/x-javascript application/json text/javascript;

uwsgi_buffering off;

server {
  listen 80 default_server;
  return 301 https://$server_name$request_uri;
}

server {
  listen 443 ssl default_server;
  add_header Strict-Transport-Security "max-age=31536000";

  location /api {
    include uwsgi_params;
    uwsgi_pass api:80;
  }

  location / {
    root /web;
  }
}

Which side is causing the problem? How do I fix it?

Chris B.
  • 337
  • 1
  • 8
  • 18

0 Answers0