最近在用comethttp long poll请求,发现使用nginx反向代理时response.flushBuffer()失效了,请求一直返回504,而直接连接tomcat不会出现问题。
高开nginx日志,出现error:
upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading re

在使用Nginx反代comethttp long poll请求时,遇到response.flushBuffer()无效导致504错误的问题。通过查看nginx日志,发现上游超时错误。进一步调试代码发现,Nginx的fastcgi_buffer_size和fastcgi_buffers设置导致数据缓冲未及时发送给客户端。解决办法是减小fastcgi_buffer_size和fastcgi_buffers,并关闭gzip,配置调整后问题得到解决。
最低0.47元/天 解锁文章
1431

被折叠的 条评论
为什么被折叠?



