{
  "id": "nginx/upstream-sent-invalid-content-encoding",
  "signature": "upstream sent invalid content-encoding while reading response header from upstream",
  "signature_zh": "上游发送了无效的 Content-Encoding 头",
  "regex": "upstream sent invalid content-encoding while reading response header from upstream",
  "domain": "nginx",
  "category": "protocol_error",
  "subcategory": null,
  "root_cause": "Upstream server returned a Content-Encoding header with an unsupported or malformed value (e.g., 'gzip;q=1.0' instead of 'gzip'), causing nginx to fail decompression.",
  "root_cause_type": "generic",
  "root_cause_zh": "上游服务器返回了不受支持或格式错误的 Content-Encoding 头（例如 'gzip;q=1.0' 而非 'gzip'），导致 nginx 解压缩失败。",
  "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": "This only compresses responses from nginx to client, not upstream response handling.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This prevents upstream from sending compressed responses, but if upstream still sends Content-Encoding, the error persists.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The error is about header value validity, not size.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Fix upstream server to return valid Content-Encoding (e.g., in PHP: header('Content-Encoding: gzip'); not 'gzip;q=1.0'). For Apache backend, ensure mod_deflate uses correct header.",
      "success_rate": 0.95,
      "how": "Fix upstream server to return valid Content-Encoding (e.g., in PHP: header('Content-Encoding: gzip'); not 'gzip;q=1.0'). For Apache backend, ensure mod_deflate uses correct header.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Add proxy_ignore_headers Content-Encoding; in nginx config to ignore upstream encoding and treat response as uncompressed. Example: location / { proxy_pass http://backend; proxy_ignore_headers Content-Encoding; }",
      "success_rate": 0.8,
      "how": "Add proxy_ignore_headers Content-Encoding; in nginx config to ignore upstream encoding and treat response as uncompressed. Example: location / { proxy_pass http://backend; proxy_ignore_headers Content-Encoding; }",
      "condition": "",
      "sources": []
    },
    {
      "action": "Set proxy_set_header Accept-Encoding identity; to request uncompressed content from upstream.",
      "success_rate": 0.75,
      "how": "Set proxy_set_header Accept-Encoding identity; to request uncompressed content from upstream.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Fix upstream server to return valid Content-Encoding (e.g., in PHP: header('Content-Encoding: gzip'); not 'gzip;q=1.0'). For Apache backend, ensure mod_deflate uses correct header.",
    "Add proxy_ignore_headers Content-Encoding; in nginx config to ignore upstream encoding and treat response as uncompressed. Example: location / { proxy_pass http://backend; proxy_ignore_headers Content-Encoding; }",
    "Set proxy_set_header Accept-Encoding identity; to request uncompressed content from upstream."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://nginx.org/en/docs/http/ngx_http_proxy_module.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.89,
  "resolvable": "true",
  "first_seen": "2024-05-18",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}