How would you configure and validate that HTTP/2 (or HTTP/3) is actually being used end-to-end through a reverse proxy, rather than silently downgrading to HTTP/1.1?
Short answer
HTTP/2 and HTTP/3 support must be explicitly enabled and correctly configured at every hop in the chain (client, reverse proxy, and Kestrel itself via Protocols = HttpProtocols.Http1AndHttp2AndHttp3), and many reverse proxy configurations silently downgrade to HTTP/1.1 for the…
Advertisement
AModel answer
HTTP/2 and HTTP/3 support must be explicitly enabled and correctly configured at every hop in the chain (client, reverse proxy, and Kestrel itself via Protocols = HttpProtocols.Http1AndHttp2AndHttp3), and many reverse proxy configurations silently downgrade to HTTP/1.1 for the backend connection even when the client-facing connection uses HTTP/2 -- validating the actual protocol in use requires inspecting the real negotiated protocol (via browser dev tools' network tab, or a diagnostic tool like curl --http2), not just assuming your configuration is being honored throughout the whole chain.
builder.WebHost.ConfigureKestrel(options => {
options.ListenAnyIP(5001, listenOptions => {
listenOptions.Protocols = HttpProtocols.Http1AndHttp2AndHttp3;
listenOptions.UseHttps();
});
});
# Validate with curl
curl -I --http2 https://myapi.com/health
# Look for "HTTP/2 200" in the response to confirm HTTP/2 was actually negotiatedReal-world example
A team assumes their gRPC service benefits from HTTP/2 throughout, but curl-based testing reveals their reverse proxy was silently downgrading the backend connection to HTTP/1.1, negating gRPC's multiplexing benefits until the proxy's backend protocol configuration was explicitly corrected.
Likely follow-ups
- What are the specific benefits HTTP/2 multiplexing provides that would be lost with a silent downgrade?
- What client and infrastructure prerequisites does HTTP/3 (QUIC-based) require beyond HTTP/2?
Related topics