nginx upstream timed out (10060: A connection attempt)

错误:
2021/12/14 11:07:14 [error] 21032#27396: *169 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 reading response header from upstream, client: 127.0.0.1, server: _, request: "POST /surviveNodeList/ HTTP/1.1", upstream: "https://127.0.0.1:8089/surviveNodeList/", host: "www.fushe.com:8081", referrer: "https://www.fushe.com:8081/?"

配置代码

upstream backs {
    server 127.0.0.1:8083 max_fails=5;
    server 127.0.0.1:8084 max_fails=5;
    server 127.0.0.1:8085 max_fails=5;
    server 127.0.0.1:8087 max_fails=5;
    server 127.0.0.1:8089 max_fails=5;
    keepalive 256;           # 配置长链接
    }

server { 
    listen 8081 ssl;
    client_max_body_size 1024M;
    # CA证书对应的域名
    server_name _;
    keepalive_timeout 60;
    # 服务器证书绝对路径
    ssl_certificate ssl_file/server.crt;
    # 服务器端证书key绝对路径
    ssl_certificate_key ssl_file/server.key;
    ssl_verify_client off;
    ssl_session_cache shared:SSL:1m;
    ssl_session_timeout 5m;

 
    location / {
        # index ../html/index.html; # 首页索引文件
        #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header Connection "0";
        proxy_redirect off;
        set $upstream https://backs;
        proxy_pass $upstream;
        proxy_next_upstream error;
        proxy_http_version 1.1;
        proxy_connect_timeout 30;               #配置点1
        proxy_read_timeout 300;                  #配置点2,如果没效,可以考虑这个时间配置长一点
        proxy_send_timeout 300;                  #配置点3

    }
}
阅读 5k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题