{
  "id": "nginx/upstream-timed-out-110-connection-timed-out-while-connecting-to-upstream",
  "signature": "upstream timed out (110: Connection timed out) while connecting to upstream, client: 10.0.0.1, server: example.com, upstream: \"http://127.0.0.1:8080\"",
  "signature_zh": "上游超时（110：连接超时）在连接上游时，客户端：10.0.0.1，服务器：example.com，上游：\"http://127.0.0.1:8080\"",
  "regex": "upstream timed out \\(110: Connection timed out\\) while connecting to upstream",
  "domain": "nginx",
  "category": "timeout_error",
  "subcategory": null,
  "root_cause": "Nginx cannot establish a TCP connection to the upstream server because the server is unreachable, firewalled, or overloaded, causing the connection attempt to exceed the proxy_connect_timeout.",
  "root_cause_type": "generic",
  "root_cause_zh": "Nginx 无法与上游服务器建立 TCP 连接，因为服务器不可达、被防火墙阻止或过载，导致连接尝试超过 proxy_connect_timeout。",
  "versions": [
    {
      "version": "nginx 1.24.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "nginx 1.22.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "nginx 1.20.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "nginx 1.18.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The timeout occurs during the TCP handshake, not during data transfer; these settings do not affect connect timeout.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The error is at the transport layer; protocol version is irrelevant.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Keepalive only helps after a connection is established; it does not prevent connection timeouts.",
      "fail_rate": 0.3,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase proxy_connect_timeout to allow more time for connection:\nproxy_connect_timeout 30s;\nAlso verify upstream reachability: telnet 127.0.0.1 8080\nCheck firewall rules: iptables -L -n | grep 8080",
      "success_rate": 0.8,
      "how": "Increase proxy_connect_timeout to allow more time for connection:\nproxy_connect_timeout 30s;\nAlso verify upstream reachability: telnet 127.0.0.1 8080\nCheck firewall rules: iptables -L -n | grep 8080",
      "condition": "",
      "sources": []
    },
    {
      "action": "Add upstream server health checks and remove unhealthy servers:\nupstream backend {\n    server 127.0.0.1:8080 max_fails=3 fail_timeout=30s;\n    server 10.0.0.2:8080 backup;\n}\nThis allows nginx to skip unresponsive servers.",
      "success_rate": 0.75,
      "how": "Add upstream server health checks and remove unhealthy servers:\nupstream backend {\n    server 127.0.0.1:8080 max_fails=3 fail_timeout=30s;\n    server 10.0.0.2:8080 backup;\n}\nThis allows nginx to skip unresponsive servers.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check if the upstream server is running and listening:\nsystemctl status myapp\nnetstat -tlnp | grep 8080\nRestart the upstream service if needed.",
      "success_rate": 0.9,
      "how": "Check if the upstream server is running and listening:\nsystemctl status myapp\nnetstat -tlnp | grep 8080\nRestart the upstream service if needed.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "增加 proxy_connect_timeout 以允许更多连接时间：\nproxy_connect_timeout 30s;\n同时验证上游可达性：telnet 127.0.0.1 8080\n检查防火墙规则：iptables -L -n | grep 8080",
    "添加上游服务器健康检查并移除不健康的服务器：\nupstream backend {\n    server 127.0.0.1:8080 max_fails=3 fail_timeout=30s;\n    server 10.0.0.2:8080 backup;\n}\n这允许 nginx 跳过无响应的服务器。",
    "检查上游服务器是否正在运行并监听：\nsystemctl status myapp\nnetstat -tlnp | grep 8080\n如有必要，重新启动上游服务。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_connect_timeout",
  "official_doc_section": null,
  "error_code": "110",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-10-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}