回答
收藏
分享
举报
upstream timed out (110: Connection timed out) while reading response header from upstream
提问于2020-06-16 11:37

浏览 5.6k

1、操作系统版本:CentOS Linux release 7.6.1810 (Core)

2、软件版本:nginx-1.18.0稳定版本

3、部署架构:nginx(反向代理)+后端(windows系统+tomcat)

4、问题描述:通过域名访问后端tomcat部署的网站时,同一个目录下面的部分.js文件加载不了

image.png

image.pngimage.png

5、目前已经做了如下相关排错措施:

a、关闭nginx系统防火墙、关闭后端系统防火墙

b、nginx到后端tomcat网站端口没有问题

c、如果把无法加载成功的js文件用代码美化工具美化后,就可以加载。

6、请问还有其他故障诊断方法吗?或者诊断措施?


已修改于2023-03-16 02:12



写下您的回答
发表回答
全部回答(1)

按点赞数排序

按时间排序

如果是三次握手没有成功,需要在nginx及上游,分别用tcpdump/wireshark抓包看下,是SYN还是ACK报文丢失了,是在哪个节点丢失的,再来分析为何会丢失,又该如何恢复。

wireshark抓包参见我讲的这一课:https://time.geekbang.org/course/detail/100026801-100973

tcpdump抓包参见这里:https://time.geekbang.org/course/detail/100026801-118169

赞同

2

回复举报

回答于2020-06-17 10:37



回复陶辉
回复
提问者
NGGW
这家伙很懒还未留下介绍~
0
文章
1
问答
0
粉丝
相关问答

直接在Access-Control-Allow-Headers后参照以下代码中加粗字体格式,添加自定义需要支持的header,以逗号隔开即可。

add_header Access-Control-Allow-Headers 'Accept, Authorization,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';  


点赞 0
浏览 3.6k

第1种。参考官方文档:

“When buffering is enabled, nginx receives a response from the proxied server as soon as possible, saving it into the buffers set by the proxy_buffer_size and proxy_buffers directives. If the whole response does not fit into memory, a part of it can be saved to a temporary file on the disk. Writing to temporary files is controlled by the proxy_max_temp_file_size and proxy_temp_file_write_size directives.

When buffering is disabled, the response is passed to a client synchronously, immediately as it is received. nginx will not try to read the whole response from the proxied server. The maximum size of the data that nginx can receive from the server at a time is set by the proxy_buffer_size directive.”

点赞 0
浏览 3.3k

可以试着打开debug日志,然后看日志中记录哪里处理时间较长

配置方法:error_log  /tmp/debug.log debug;

点赞 0
浏览 4.3k