Supervisord inet_http_server behind nginx

Solution 1:

This is by design, since nginx waits until it gets the whole reply from the backend, prior to sending a response back to the client -- proxy buffering is enabled by default.

This would resolve your issue:

proxy_buffering off;

Solution 2:

For me adding the following lines worked: proxy_http_version 1.1; and proxy_set_header Connection "";

My complete working config proxying supervisor output with web based tail-f working:

server {
  listen 9000;
  listen [::]:9000;

  server_name server.gmetri.com;

  location / {
    proxy_pass http://localhost:4001;
    proxy_http_version 1.1;
    proxy_buffering     off;
    proxy_max_temp_file_size 0;
    proxy_redirect     default;
    proxy_set_header   Host             $host;
    proxy_set_header   X-Real-IP        $remote_addr;
    proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
    proxy_set_header   Connection       "";
  }
}