nginx
protocol_error
ai_generated
true
upstream sent HTTP/2.0 response while reading response header from upstream, client: 10.0.0.5
ID: nginx/upstream-sent-http-version-not-supported
75%Fix Rate
82%Confidence
1Evidence
2024-05-22First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| nginx 1.20.0 | active | — | — | — |
| nginx 1.22.1 | active | — | — | — |
| nginx 1.25.0 | active | — | — | — |
Root Cause
Upstream server sent an HTTP/2.0 response to nginx that did not negotiate HTTP/2 via ALPN, causing protocol mismatch and connection failure.
generic中文
上游服务器发送了HTTP/2.0响应,但未通过ALPN协商HTTP/2,导致协议不匹配和连接失败。
Official Documentation
https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_http_versionWorkarounds
-
85% success Configure upstream to use HTTP/1.1 instead of HTTP/2. For example, in Apache: disable HTTP/2 module; in Node.js: set HTTP/1.1 explicitly.
Configure upstream to use HTTP/1.1 instead of HTTP/2. For example, in Apache: disable HTTP/2 module; in Node.js: set HTTP/1.1 explicitly.
-
60% success If upstream must use HTTP/2, place a reverse proxy like HAProxy or Caddy between nginx and the upstream that can downgrade HTTP/2 to HTTP/1.1.
If upstream must use HTTP/2, place a reverse proxy like HAProxy or Caddy between nginx and the upstream that can downgrade HTTP/2 to HTTP/1.1.
-
70% success Ensure upstream server correctly negotiates HTTP/2 via TLS ALPN (e.g., for nginx as upstream, use 'listen 443 ssl http2;').
Ensure upstream server correctly negotiates HTTP/2 via TLS ALPN (e.g., for nginx as upstream, use 'listen 443 ssl http2;').
中文步骤
Configure upstream to use HTTP/1.1 instead of HTTP/2. For example, in Apache: disable HTTP/2 module; in Node.js: set HTTP/1.1 explicitly.
If upstream must use HTTP/2, place a reverse proxy like HAProxy or Caddy between nginx and the upstream that can downgrade HTTP/2 to HTTP/1.1.
Ensure upstream server correctly negotiates HTTP/2 via TLS ALPN (e.g., for nginx as upstream, use 'listen 443 ssl http2;').
Dead Ends
Common approaches that don't work:
-
90% fail
Nginx proxy module does not support HTTP/2 as upstream protocol; setting it will cause configuration error.
-
95% fail
As of nginx 1.25.x, HTTP/2 upstream is not supported in the proxy module; this is a limitation of nginx itself.
-
80% fail
The error will recur on every request; retries do not fix the protocol mismatch.