Nginx upstream prematurely closed connection while reading response header from upstream, for large requests

前端 未结 9 1030
無奈伤痛
無奈伤痛 2020-12-24 04:27

I am using nginx and node server to serve update requests. I get a gateway timeout when I request an update on large data. I saw this error from the nginx error logs :

<
9条回答
  •  天命终不由人
    2020-12-24 05:21

    I solved this by setting a higher timeout value for the proxy:

    location / {
        proxy_read_timeout 300s;
        proxy_connect_timeout 75s;
        proxy_pass http://localhost:3000;
    }
    

    Documentation: https://nginx.org/en/docs/http/ngx_http_proxy_module.html

提交回复
热议问题