nginx访问速度慢,报upstream timed ou错误

错误信息
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, client: 127.0.0.1, server: localhost, request: “GET /tomcat.css HTTP/1.1”, upstream: “http://[::1]:8080/tomcat.css“, host: “localhost”, referrer: “http://localhost/”

解决:将localhost 改成 ip或者在 hosts 文件 加上 127.0.0.1 localhost

同时设置一下在连接时间
proxy_connect_timeout 300; #nginx跟后端服务器连接超时时间(代理连接超时)
proxy_send_timeout 300; #后端服务器数据回传时间(代理发送超时)
proxy_read_timeout 600; #连接成功后,后端服务器响应时间(代理接收超时)

posted @ 2022-10-24 20:56  享受生活2023  阅读(991)  评论(0编辑  收藏  举报