8

I have 3 server: A(nginx)-->B(nginx)-->C(nodejs),

When i access A or B,chrome use http/1.1+keepalive by default.

I do not set "proxy_http_version 1.1;" and proxy_set_header Connection "";

But between A and B,NGINX use http/1.0 by default。That is like:

client --> nginxA(upstream to b) --> nginxB(upstream to c) -->C (nodejs)

http/1.1 --> http/1.0 --> http/1.1 --> nodejs

My questions is : why nginx use http/1.1 for upstream by default,between nginx and nginx, upstream use http/1.0 ?

THX.

monkey
  • 83
  • 1
  • 1
  • 5

1 Answers1

10

Nginx since version 1.1.4 supports HTTP/1.1 when connecting to upstream servers. You just need to set configuration parameter proxy_http_version 1.1 (1.0 is the default value). see http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_http_version

  • 1
    then a question is why they have the proxy http verison default to 1.0 and not 1.1 – dtc Mar 07 '23 at 01:30