【发布时间】:2016-04-25 20:46:23
【问题描述】:
背景
我已经hosting multiple node.js apps on a single VPS 有一段时间了,一切都很好。
我可以通过使用 nginx 将流量路由到 node.js 应用程序所需的不同端口来做到这一点。
升级到 http2
使用最近的push for http2,我一直在尝试通过启用 http2 来支持我的应用程序。在 nginx 上,我可以通过 nginx 的following the guide 这样做。
问题
在进行基准测试时,性能似乎没有提高,而在测试网站上使用 http2 时会获取 47 个主页请求。
理论
可能是因为 nodejs 服务的是 http1 而不是 http2?
我必须在 nginx 和我的 nodejs 应用程序之间设置什么吗?例如proxy_http_version: 2.0 但是,proxy_http_version 2.0 doesn't seem to be available yet。
我的 nodejs 应用程序与 express 一起使用,所以我真的获得了 http2 连接还是获得了 http 连接?
当我使用http2 indicator 时,它通过指示蓝光告诉我该网站正在使用http2。 我必须使用molnarg's http2 module还是nginx http2模块就足够了?
希望有更多开发运维经验的人可以帮助我和许多其他开发人员解决这个问题。
【问题讨论】:
-
你知道http2其实是https的继承者吗?