Use HTTP / 2.0 entre o proxy reverso nginx e o servidor backend

12

Eu uso o nginx como um proxy-ssl reverso na frente de um servidor web de back-end que é capaz de fazer HTTP / 2.0.

Percebi que o nginx faz proxy das solicitações para o servidor de backend via HTTP / 1.1 em vez de HTTP / 2.0. É possível dizer ao nginx para usar uma conexão HTTP / 2.0 não criptografada? Isso aumentaria o desempenho?

    
por S1lentSt0rm 22.03.2016 / 10:43

2 respostas

13

Encontrou isto: link

There are no plans to implement HTTP/2 support in the proxy module in the foreseeable future

Trecho de um e-mail mencionado no ticket:

There is almost no sense to implement it, as the main HTTP/2 benefit is that it allows multiplexing many requests within a single connection, thus [almost] removing the limit on number of simalteneous requests - and there is no such limit when talking to your own backends. Moreover, things may even become worse when using HTTP/2 to backends, due to single TCP connection being used instead of multiple ones.

    
por 22.03.2016 / 16:11
2

Infelizmente, o nginx não suporta proxy para um servidor de backend http / 2, referenciado a partir de link

Q: Will you support HTTP/2 on the upstream side as well, or only support HTTP/2 on the client side?

A: At the moment, we only support HTTP/2 on the client side. You can’t configure HTTP/2 with proxy_pass. [Editor – In the original version of this post, this sentence was incorrectly transcribed as “You can configure HTTP/2 with proxy_pass.” We apologize for any confusion this may have caused.]

But what is the point of HTTP/2 on the backend side? Because as you can see from the benchmarks, there’s not much benefit in HTTP/2 for low‑latency networks such as upstream connections.

Also, in NGINX you have the keepalive module, and you can configure a keepalive cache. The main performance benefit of HTTP/2 is to eliminate additional handshakes, but if you do that already with a keepalive cache, you don’t need HTTP/2 on the upstream side.

    
por 26.09.2017 / 05:23