nginx
protocol_error
ai_generated
true
upstream sent HTTP/1.1 response while reading response header from upstream
ID: nginx/upstream-sent-http-1-1-response-while-reading-response-header
85%Fix Rate
88%Confidence
1Evidence
2023-11-15First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| nginx 1.20.x | active | — | — | — |
| nginx 1.22.x | active | — | — | — |
| nginx 1.24.x | active | — | — | — |
| Apache 2.4.x | active | — | — | — |
| Gunicorn 20.x | active | — | — | — |
Root Cause
Upstream server returns HTTP/1.1 response but Nginx is configured to expect HTTP/1.0, causing header parsing mismatch.
generic中文
上游服务器返回HTTP/1.1响应,但Nginx配置为期望HTTP/1.0,导致头部解析不匹配。
Official Documentation
https://nginx.org/en/docs/http/ngx_http_upstream_module.html#proxy_http_versionWorkarounds
-
85% success Set proxy_http_version to 1.1 in the location block: proxy_http_version 1.1;
Set proxy_http_version to 1.1 in the location block: proxy_http_version 1.1;
-
70% success Configure upstream to return HTTP/1.0 responses if possible.
Configure upstream to return HTTP/1.0 responses if possible.
中文步骤
在location块中设置proxy_http_version为1.1:proxy_http_version 1.1;
如果可能,配置上游返回HTTP/1.0响应。
Dead Ends
Common approaches that don't work:
-
Disabling HTTP/1.1 support on upstream
60% fail
Upstream servers often default to HTTP/1.1; disabling may break functionality.
-
Increasing proxy buffer sizes
80% fail
Buffer size does not affect protocol version negotiation.
-
Adding proxy_set_header Host $host
90% fail
Header manipulation doesn't change protocol version.