nginx 訪問 nodejs 慢的問題

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;
}

增加配置後,重啓後,再訪問速度很快了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章