Nginx 504 Bad Gateway错误


0

我有一个java servlet环境,故意保持http连接打开并将数据发送到客户端。这个连接在50秒后被删除,我在nginx.conf文件中尝试了不同的设置,但没有一个有效。

我收到了这个错误。

上游超时(110:连接超时),同时从上游读取响应头,客户端:{Some IP},server :, request:“GET / {some path} HTTP / 1.1”,上游:“ http://127.0。 0.1:5000 / “,主持人:”sadfdsa.us-west-1.elb.amazonaws.com“


你的ELB的连接超时是多少?
Alex

这是我已经尝试过的事情之一,我从60增加到120秒,这是默认但仍然没有。
gerfmarquez

1
你检查过nginx的超时参数了吗?proxy_read_timeout,proxy_send_timeout默认设置为60s。
un'amed

是的,实际上这是有效的解决方案,但我错过了更新答案。
gerfmarquez 2017年

Answers:


1
Syntax:     proxy_send_timeout time;
Default:    proxy_send_timeout 60s;
Context:    http, server, location
The timeout is set only between two successive write operations, not for the transmission of the whole request.

Syntax:     proxy_read_timeout time;
Default:    proxy_read_timeout 60s;
Context:    http, server, location
The timeout is set only between two successive read operations, not for the transmission of the whole response.

编辑那些显然有助于提问者。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.