Score:0

(nginx) is it possible to preserve http protocol?

cn flag

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?

user9517 avatar
cn flag
Search is your friend https://serverfault.com/search?q=nginx+reverse+proxy+
cn flag
Bob
You probably do need passthough because the nginx reverse proxy module and the [`proxy_http_version`](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_http_version) directive only allows you to select HTTP protocol version `1.0` or `1.1` and 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
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.