{
  "id": "nginx/client-closed-connection-while-reading-response",
  "signature": "client closed connection while reading response header from upstream",
  "signature_zh": "客户端在从上游读取响应头时关闭了连接",
  "regex": "client closed connection while reading response header from upstream",
  "domain": "nginx",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "Client disconnects prematurely before nginx finishes reading the upstream response header, typically due to browser timeout or user cancellation.",
  "root_cause_type": "generic",
  "root_cause_zh": "客户端在Nginx完成从上游读取响应头之前提前断开连接，通常由浏览器超时或用户取消引起。",
  "versions": [
    {
      "version": "nginx 1.18.0",
      "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.22.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "nginx 1.24.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "nginx 1.25.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The issue is client disconnection, not upstream timeout; high timeout may mask the problem but doesn't prevent it.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Keepalive settings affect connection reuse, not client disconnection during response reading.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Disabling buffering can increase memory usage and doesn't address the root cause of client disconnection.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Set proxy_ignore_client_abort on; in the location block: proxy_ignore_client_abort on;",
      "success_rate": 0.85,
      "how": "Set proxy_ignore_client_abort on; in the location block: proxy_ignore_client_abort on;",
      "condition": "",
      "sources": []
    },
    {
      "action": "Reduce response generation time by optimizing upstream application or enabling caching: proxy_cache my_cache; proxy_cache_valid 200 1h;",
      "success_rate": 0.75,
      "how": "Reduce response generation time by optimizing upstream application or enabling caching: proxy_cache my_cache; proxy_cache_valid 200 1h;",
      "condition": "",
      "sources": []
    },
    {
      "action": "Increase client_header_timeout and client_body_timeout to prevent premature disconnection: client_header_timeout 60s; client_body_timeout 60s;",
      "success_rate": 0.7,
      "how": "Increase client_header_timeout and client_body_timeout to prevent premature disconnection: client_header_timeout 60s; client_body_timeout 60s;",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "在location块中设置 proxy_ignore_client_abort on;",
    "通过优化上游应用或启用缓存来减少响应生成时间：proxy_cache my_cache; proxy_cache_valid 200 1h;",
    "增加 client_header_timeout 和 client_body_timeout 以防止过早断开：client_header_timeout 60s; client_body_timeout 60s;"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ignore_client_abort",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.82,
  "resolvable": "partial",
  "first_seen": "2023-05-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}