The scenario is exactly the same on this post. But I need an nginx solution. I am not introducing haproxy or any additional service on top of it.
答案 0 :(得分:1)
Nginx不支持HTTP / 2中的后端连接,并且无意将其引入(有关详细信息,请参阅我对this question的回答)。
所以你唯一的选择是引入haproxy,一些额外的服务或从Nginx切换到Apache(它支持与mod_proxy_http2的HTTP / 2后端连接)。
为什么你觉得后端需要HTTP / 2?如上面链接的相同答案中详述的,大多数HTTP / 2优势来自前端的HTTP / 2。我可以考虑在后端使用它的唯一真正原因是支持HTTP / 2服务器推送,但是Nginx不支持这样,所以这是另一个非跑步者,除非你切换到Apache或支持它的其他服务器。 / p>