【问题标题】:why between nginx/nginx upstream use http/1.0?为什么 nginx/nginx 上游之间使用 http/1.0?
【发布时间】:2017-05-06 11:25:01
【问题描述】:

我有 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作为upstream,在nginx和nginx之间,upstream使用http/1.0?

谢谢。

【问题讨论】:

  • 你确定你没有配置 nginx 使用 http/1.1 作为节点?
  • 是的,我确定。我使用的是 Tengine-2.2.0(基于 Nginx-1.8.1)。感谢您的快速回复。
  • 我想我找到了我的结果:serverfault.com/questions/442960/…thanks~

标签: nginx keep-alive http-1.1 http-1.0


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2015-05-18
    • 2020-02-22
    • 2011-08-18
    • 2015-06-29
    • 1970-01-01
    • 2011-01-08
    • 2014-11-17
    • 1970-01-01
    • 2019-07-11
    相关资源
    最近更新 更多