1.问题现象

通过nginx 访问 nodejs 访问特别慢。但是通过nodejs 直接访问速度很快响应。

2.日志错误

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 connecting to upstream

3.配置修改如下

location /jpaas {
        proxy_set_header Host       $host;
        #proxy_pass http://192.168.3.225;
        proxy_pass http://localhost:8002;
		# 下面 为增加的配置
        proxy_connect_timeout 1; 
		proxy_send_timeout 30; 
		proxy_read_timeout 60;
}

增加配置后,重启后,再访问速度很快了。

版权声明:本文为自由港原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/yg_zhang/p/16556190.html