{
  "id": "nginx/upstream-sent-invalid-connection-header",
  "signature": "upstream sent invalid Connection header while reading response header from upstream",
  "signature_zh": "上游发送了无效的Connection头，同时从上游读取响应头",
  "regex": "upstream sent invalid Connection header while reading response header from upstream",
  "domain": "nginx",
  "category": "protocol_error",
  "subcategory": null,
  "root_cause": "Upstream server returns a malformed or non-compliant 'Connection' header (e.g., multiple values, invalid token) that nginx rejects.",
  "root_cause_type": "generic",
  "root_cause_zh": "",
  "versions": [
    {
      "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"
    },
    {
      "version": "nginx 1.26.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Add proxy_set_header Connection '';",
      "why_fails": "This only affects request headers sent to upstream, not response headers from upstream.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Clear nginx cache",
      "why_fails": "Caching does not cause or fix header validation issues.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "Upgrade nginx to latest version",
      "why_fails": "The issue is usually in the upstream application, not nginx itself.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use proxy_ignore_headers to ignore the Connection header from upstream:\n  location / {\n      proxy_pass http://upstream;\n      proxy_ignore_headers Connection;\n  }",
      "success_rate": 0.9,
      "how": "Use proxy_ignore_headers to ignore the Connection header from upstream:\n  location / {\n      proxy_pass http://upstream;\n      proxy_ignore_headers Connection;\n  }",
      "condition": "",
      "sources": []
    },
    {
      "action": "Fix the upstream application to emit a valid Connection header (e.g., 'close' or 'keep-alive' only, no duplicates). For example, in a Node.js app:\n  res.setHeader('Connection', 'keep-alive');\n  // Remove any duplicate or malformed Connection headers",
      "success_rate": 0.95,
      "how": "Fix the upstream application to emit a valid Connection header (e.g., 'close' or 'keep-alive' only, no duplicates). For example, in a Node.js app:\n  res.setHeader('Connection', 'keep-alive');\n  // Remove any duplicate or malformed Connection headers",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Use proxy_ignore_headers to ignore the Connection header from upstream:\n  location / {\n      proxy_pass http://upstream;\n      proxy_ignore_headers Connection;\n  }",
    "Fix the upstream application to emit a valid Connection header (e.g., 'close' or 'keep-alive' only, no duplicates). For example, in a Node.js app:\n  res.setHeader('Connection', 'keep-alive');\n  // Remove any duplicate or malformed Connection headers"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ignore_headers",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2024-06-22",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}