5

我有 3 个服务器:A(nginx)-->B(nginx)-->C(nodejs),

当我访问 A 或 B 时,chrome 默认使用 http/1.1+keepalive。

我没有设置“proxy_http_version 1.1;” 和 proxy_set_header 连接“”;

但是在A和B之间,NGINX默认使用http/1.0。就是这样:

客户端--> nginxA(上游到b) --> nginxB(上游到c) --> C(nodejs)

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

我的问题是:为什么nginx默认使用http/1.1作为上游,在nginx和nginx之间,上游使用http/1.0?

谢谢。

4

1 回答 1

6

Nginx 从 1.1.4 版本开始在连接上游服务器时支持 HTTP/1.1。您只需要设置配置参数proxy_http_version 1.1(1.0 是默认值)。见http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_http_version

于 2019-05-23T13:46:16.997 回答