I have a backend server that receives HTTP/1.1, HTTP/2.0 plaintext, grpc plaintext over HTTP/2.0 (no tls).
I want to use nginx to receive HTTP request from user (HTTP/1.1, HTTP/2, etc), and pass to backend, preserving HTTP version without using passthrough.
so, desired state is below.
1. client <-(HTTP/1.1 plaintext)-> nginx <-(HTTP/1.1 plaintext)-> backend
2. client <-(HTTP/2 plaintext)-> nginx <-(HTTP/2 plaintext)-> backend
3. client <-(grpc over HTTP/2 plaintext)-> nginx <-(grpc over HTTP/2 plaintext)-> backend
on a same ip, same port.
is this possible?
proxy_http_versiondirective only allows you to select HTTP protocol version1.0or1.1and talking to backends with HTTP/2 is not supported at all. See this Q&A https://serverfault.com/questions/765258/use-http-2-0-between-nginx-reverse-proxy-and-backend-webserver – Bob Feb 15 '22 at 11:08