upstream timed out (10060: A connection attempt failed because the connected party did not properly ...

6068 단어
openresty 오류 로그 오류 내용:
2019/01/22 11:58:10 [error] 12504#15104: *547160484 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: 10.4.101.11, server: localhost, request: "GET /xxx.jsp HTTP/1.1", upstream: "http://[::1]:8080/xxx.jsp", host: "10.1.3.42", referrer: "http://10.1.3.42/xxxindex.jsp"
2019/01/22 12:00:44 [error] 12504#15104: *547194371 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: 10.4.101.11, server: localhost, request: "GET /xxx.jsp HTTP/1.1", upstream: "http://[::1]:8080/xxx.jsp", host: "10.1.3.42", referrer: "http://10.1.3.42/xxxxxex.jsp"

nginx.conf 구성은 다음과 같습니다.
    upstream tomcat {
        server localhost:9999 weight=1 max_fails=5;       
        server localhost:8080 weight=9 max_fails=5;
        server 10.1.3.43:8080 weight=9 max_fails=5;
        ip_hash;
    }
    
    upstream file_tomcat {
        server localhost:9999 weight=1 max_fails=5;       
        server localhost:8080 weight=9 max_fails=5;
        ip_hash;
    }

오류 메시지가 표시됩니다.
upstream: "http://[::1]:8080/xxx.jsp

분명히 localhost가 IPV6를 사용하여 접근했기 때문에 문제가 발생했습니다.
locaohost를 127.0.1로 변경하면 됩니다.
    upstream tomcat {
        server 127.0.0.1:9999 weight=1 max_fails=5;       
        server 127.0.0.1:8080 weight=9 max_fails=5;
        server 10.1.3.43:8080 weight=9 max_fails=5;
        ip_hash;
    }
    
    upstream file_tomcat {
        server 127.0.0.1:9999 weight=1 max_fails=5;       
        server 127.0.0.1:8080 weight=9 max_fails=5;
        ip_hash;
    }

 
다음으로 전송:https://www.cnblogs.com/digdeep/p/10305143.html

좋은 웹페이지 즐겨찾기