在看似正确的安装之后,HTTP/2 似乎没有运行。
我正在运行 CentOS 7。
我安装了最新版本的 Apache,版本 httpd-2.4.35-5.el7.x86_64,并且一直在尝试让 HTTP/2 正常工作。
为此,我看到我们需要运行 http2_module。那是积极的和正在运行的。我相信已经通过运行命令确认了这一点httpd -M。http2_module(共享)列在这些模块下。
我知道要做的下一件事是在标签Protocols h2 h2c http/1.1上方<VirtualHost ...>添加。我也这样做了。
最后,我对我的 URL 进行了 CURL 处理,但我仍然收到 HTTP/1.1。
卷曲命令:curl -vsko /dev/null --http2 https://www.thehomepainter.com
CURL 的简要回复:
GET / HTTP/1.1 主机:www.thehomepainter.com 用户代理:curl/7.64.0 接受:/
< HTTP/1.1 200 OK
部分来自 httpd.conf
Protocols h2 h2c http/1.1
<VirtualHost *:443>
SSLEngine on
ServerAdmin ### omitted ###
ServerName thehomepainter.com
ServerAlias www.thehomepainter.com
DocumentRoot /var/www/html/
Options -Indexes
ProxyRequests off
ProxyPreserveHost On
AllowEncodedSlashes NoDecode
ProxyPass "/" "http://localhost:3000/" …Run Code Online (Sandbox Code Playgroud)