{
  "id": "nginx/upstream-sent-http-1-0-response-while-reading-response-header-from-upstream",
  "signature": "upstream sent HTTP/1.0 response while reading response header from upstream",
  "signature_zh": "上游在读取响应头时发送了HTTP/1.0响应",
  "regex": "upstream sent HTTP/1.0 response while reading response header from upstream",
  "domain": "nginx",
  "category": "protocol_error",
  "subcategory": null,
  "root_cause": "Upstream server responded with HTTP/1.0 instead of HTTP/1.1, causing nginx to reject or handle headers differently.",
  "root_cause_type": "generic",
  "root_cause_zh": "上游服务器以HTTP/1.0而非HTTP/1.1响应，导致nginx拒绝或以不同方式处理头部。",
  "versions": [
    {
      "version": "nginx 1.18.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "nginx 1.20.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "nginx 1.22.0",
      "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"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "This forces nginx to use HTTP/1.0 to upstream, but the upstream might still send HTTP/1.0 responses, and nginx may still reject them if it expects HTTP/1.1.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The issue is not buffer size but protocol version mismatch; buffer size does not change the response version.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Keepalive settings affect connection reuse, not the HTTP version of responses.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Configure the upstream server to use HTTP/1.1. For example, in Apache HTTPD as upstream, set:\n\n<IfModule mod_remoteip.c>\n    RemoteIPHeader X-Forwarded-For\n    RemoteIPInternalProxy 10.0.0.0/8\n</IfModule>\n\nAnd ensure mod_proxy_http uses HTTP/1.1 by default.",
      "success_rate": 0.8,
      "how": "Configure the upstream server to use HTTP/1.1. For example, in Apache HTTPD as upstream, set:\n\n<IfModule mod_remoteip.c>\n    RemoteIPHeader X-Forwarded-For\n    RemoteIPInternalProxy 10.0.0.0/8\n</IfModule>\n\nAnd ensure mod_proxy_http uses HTTP/1.1 by default.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Add proxy_http_version 1.1; and proxy_set_header Connection \"\"; to nginx location block:\n\nlocation / {\n    proxy_http_version 1.1;\n    proxy_set_header Connection \"\";\n    proxy_pass http://upstream;\n}",
      "success_rate": 0.75,
      "how": "Add proxy_http_version 1.1; and proxy_set_header Connection \"\"; to nginx location block:\n\nlocation / {\n    proxy_http_version 1.1;\n    proxy_set_header Connection \"\";\n    proxy_pass http://upstream;\n}",
      "condition": "",
      "sources": []
    },
    {
      "action": "If upstream cannot be changed, use nginx as a reverse proxy with proxy_pass http://upstream; and set proxy_http_version 1.0; to match upstream behavior:\n\nlocation / {\n    proxy_http_version 1.0;\n    proxy_set_header Connection close;\n    proxy_pass http://upstream;\n}",
      "success_rate": 0.7,
      "how": "If upstream cannot be changed, use nginx as a reverse proxy with proxy_pass http://upstream; and set proxy_http_version 1.0; to match upstream behavior:\n\nlocation / {\n    proxy_http_version 1.0;\n    proxy_set_header Connection close;\n    proxy_pass http://upstream;\n}",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Configure the upstream server to use HTTP/1.1. For example, in Apache HTTPD as upstream, set:\n\n<IfModule mod_remoteip.c>\n    RemoteIPHeader X-Forwarded-For\n    RemoteIPInternalProxy 10.0.0.0/8\n</IfModule>\n\nAnd ensure mod_proxy_http uses HTTP/1.1 by default.",
    "Add proxy_http_version 1.1; and proxy_set_header Connection \"\"; to nginx location block:\n\nlocation / {\n    proxy_http_version 1.1;\n    proxy_set_header Connection \"\";\n    proxy_pass http://upstream;\n}",
    "If upstream cannot be changed, use nginx as a reverse proxy with proxy_pass http://upstream; and set proxy_http_version 1.0; to match upstream behavior:\n\nlocation / {\n    proxy_http_version 1.0;\n    proxy_set_header Connection close;\n    proxy_pass http://upstream;\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_http_version",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.8,
  "resolvable": "partial",
  "first_seen": "2023-05-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}