{
  "id": "nginx/upstream-sent-invalid-status-line",
  "signature": "upstream sent invalid status line while reading response header from upstream",
  "signature_zh": "上游发送了无效的状态行",
  "regex": "upstream sent invalid status line while reading response header from upstream",
  "domain": "nginx",
  "category": "protocol_error",
  "subcategory": null,
  "root_cause": "Upstream server returned an HTTP status line that does not conform to RFC 7230 (e.g., missing HTTP version, malformed status code).",
  "root_cause_type": "generic",
  "root_cause_zh": "上游服务器返回的 HTTP 状态行不符合 RFC 7230（例如缺少 HTTP 版本、状态码格式错误）。",
  "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"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Trailing slash affects URI normalization, not the status line format from upstream.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Buffering does not affect header parsing; nginx always parses the status line.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This clears response headers, not the status line itself.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Fix upstream server to return valid HTTP status line (e.g., in Python: ensure response starts with 'HTTP/1.1 200 OK\\r\\n'). Example using Flask: return 'OK', 200, {'Content-Type': 'text/plain'}",
      "success_rate": 0.95,
      "how": "Fix upstream server to return valid HTTP status line (e.g., in Python: ensure response starts with 'HTTP/1.1 200 OK\\r\\n'). Example using Flask: return 'OK', 200, {'Content-Type': 'text/plain'}",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a custom upstream module or script to sanitize response before nginx processes it (e.g., using lua-nginx-module: content_by_lua_block { ngx.say('OK') })",
      "success_rate": 0.7,
      "how": "Use a custom upstream module or script to sanitize response before nginx processes it (e.g., using lua-nginx-module: content_by_lua_block { ngx.say('OK') })",
      "condition": "",
      "sources": []
    },
    {
      "action": "Add proxy_http_version 1.0; to force HTTP/1.0 and expect simpler status line.",
      "success_rate": 0.75,
      "how": "Add proxy_http_version 1.0; to force HTTP/1.0 and expect simpler status line.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Fix upstream server to return valid HTTP status line (e.g., in Python: ensure response starts with 'HTTP/1.1 200 OK\\r\\n'). Example using Flask: return 'OK', 200, {'Content-Type': 'text/plain'}",
    "Use a custom upstream module or script to sanitize response before nginx processes it (e.g., using lua-nginx-module: content_by_lua_block { ngx.say('OK') })",
    "Add proxy_http_version 1.0; to force HTTP/1.0 and expect simpler status line."
  ],
  "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": null,
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.87,
  "resolvable": "true",
  "first_seen": "2024-04-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}