在 CentOS 7 上支持 HTTP/2 ALPN 的 Passenger nginx

Passenger nginx with HTTP/2 ALPN support on CentOS 7

我在 this guide.

之后安装了 passenger-moded 版本的 nginx

不幸的是,RPM 中的 nginx 版本是使用 OpenSSL 1.0.1e 构建的,它不提供 HTTP/2 ALPN 支持。从源代码构建 nginx 是我在此配置中启用 HTTP/2 的唯一选择吗?

您有几个选择:

  1. 使用同样从源构建的 OpenSSL 从源安装。
  2. 使用Docker或其他容器技术运行。
  3. 升级到 Centos 7.4 (literally just released at time of writing) as this includes OpenSSL 1.0.2 which includes ALPN support.
  4. 在您的服务器前面使用 CDN,以便它们提供 HTTP/2 支持,您现在可以继续使用 HTTP/1。 Cloudflare offer free plans for this 例如。
  5. 与上面类似,在Nginx前面放置另一个server/load平衡器,支持HTTP/2并代理请求到Nginx。