{
  "id": "nginx/upstream-server-refused-connection",
  "signature": "connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.1, server: example.com, upstream: \"http://127.0.0.1:8080\"",
  "signature_zh": "连接到上游时连接被拒绝（111），客户端：192.168.1.1，服务器：example.com，上游：\"http://127.0.0.1:8080\"",
  "regex": "connect\\(\\) failed \\(111: Connection refused\\)",
  "domain": "nginx",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The upstream server is not listening on the specified port or IP, either because it is not running or is bound to a different address.",
  "root_cause_type": "generic",
  "root_cause_zh": "上游服务器未在指定端口或 IP 上监听，可能是因为它未运行或绑定到了不同的地址。",
  "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"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Connection refused is an immediate TCP error; timeout does not help.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The error is about TCP connection, not URI path issues.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Nginx is working fine; the upstream service is down or misconfigured.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Verify the upstream service is running: `sudo systemctl status myapp` or `netstat -tlnp | grep 8080`. Start it if needed: `sudo systemctl start myapp`.",
      "success_rate": 0.95,
      "how": "Verify the upstream service is running: `sudo systemctl status myapp` or `netstat -tlnp | grep 8080`. Start it if needed: `sudo systemctl start myapp`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check if the upstream is listening on a different interface (e.g., 0.0.0.0 vs 127.0.0.1). Update the proxy_pass directive to match the actual listening address.",
      "success_rate": 0.9,
      "how": "Check if the upstream is listening on a different interface (e.g., 0.0.0.0 vs 127.0.0.1). Update the proxy_pass directive to match the actual listening address.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If using a Unix socket, ensure the socket file exists and has correct permissions. Example: `ls -la /var/run/myapp.sock` and adjust nginx upstream to `server unix:/var/run/myapp.sock;`",
      "success_rate": 0.85,
      "how": "If using a Unix socket, ensure the socket file exists and has correct permissions. Example: `ls -la /var/run/myapp.sock` and adjust nginx upstream to `server unix:/var/run/myapp.sock;`",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Verify the upstream service is running: `sudo systemctl status myapp` or `netstat -tlnp | grep 8080`. Start it if needed: `sudo systemctl start myapp`.",
    "Check if the upstream is listening on a different interface (e.g., 0.0.0.0 vs 127.0.0.1). Update the proxy_pass directive to match the actual listening address.",
    "If using a Unix socket, ensure the socket file exists and has correct permissions. Example: `ls -la /var/run/myapp.sock` and adjust nginx upstream to `server unix:/var/run/myapp.sock;`"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://nginx.org/en/docs/http/ngx_http_upstream_module.html",
  "official_doc_section": null,
  "error_code": "111",
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.95,
  "resolvable": "true",
  "first_seen": "2024-09-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}