title: Nginx upstream prematurely closed connection while reading response header from upstream form Node js rocky proxy
body: <p>I have nginx and one node server which works as proxy between java backend servers.
  my nginx config</p>
  
  <pre><code>server {
  listen 80;
  
  server_name peoplehum.dev www.peoplehum.dev;
  #rewrite ^/(.*)/$ /$1 permanent;
  charset utf-8;
  keepalive_requests 100;
  keepalive_timeout 100s;
  gzip on;
  gzip_http_version 1.1;
  gzip_vary on;
  gzip_comp_level 6;
  gzip_proxied any;
  gzip_buffers 16 8k;
  gzip_disable "MSIE [1-6]\.(?!.*SV1)";
  client_max_body_size 16M;
  
  #include /etc/nginx/proxy_header.conf;
  #include /etc/nginx/proxy_buffer.conf;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "upgrade";
  proxy_http_version 1.1;
  proxy_set_header HOST $host;
  
  #X-Forwarded-Proto header gives the proxied server information about the schema of the original client request (whether it was an http or an https request).
  proxy_set_header X-Forwarded-Proto $scheme;
  
  #The X-Real-IP is set to the IP address of the client so that the proxy can correctly make decisions or log based on this information.
  proxy_set_header X-Real-IP $remote_addr;
  
  #The X-Forwarded-For header is a list containing the IP addresses of every server the client has been proxied through up to this point.
  #In the example above, we set this to the $proxy_add_x_forwarded_for variable.
  #This variable takes the value of the original X-Forwarded-For header retrieved from the client and adds the Nginx server's IP address to the end.
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }
  </code></pre>
  
  <p>here, when i send big body request to nginx to my node proxy server it gives upstream prematurely closed connection while reading response header from upstream.</p>
  
  <p>I am using rocky proxy--> <a href="https://github.com/h2non/rocky" rel="nofollow noreferrer">https://github.com/h2non/rocky</a> on node js for proxy.
  I have searched alot and tried most of other question answers related this but nothing worked out.</p>