AWS Nginx “upstream prematurely closed connection while reading response header from upstream”

一曲冷凌霜 提交于 2019-12-10 19:15:01

问题


I use AWS: ELB (classic) → EC2 (with Node.js)

Problem. Sometimes some requests return 502 Bad Gateway error. In Nginx error log a I see "upstream prematurely closed connection while reading response header from upstream" error.

Not timeout issue. This error happens the same second this request in handled by Node.js application. So it is not a timeout issue because of the long response.

Client doesn't break connection. I tried to make request programaticly (to be sure that client doesn't break connection). And sometimes got the same error, while test client-application got response with 502 error from Ngnix.

Who can close connection and why? How to fix this issue?

来源:https://stackoverflow.com/questions/49778807/aws-nginx-upstream-prematurely-closed-connection-while-reading-response-header

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!