make install
目前 1.9以上的 nginx 才能支持 http 2.0 ;
第一步 查看版本,安装
进入到sbin目录 执行 ./nginx -v
[root@iZbp1edeafcssqqrig628eZ sbin]# ./nginx -v
nginx version: nginx/1.10.3
由于 Nginx 默认是不开启 Http2.0 需要手动安装依赖模块
[root@iZbp1edeafcssqqrig628eZ sbin]# cd /usr/local/src/nginx-1.10.3
[root@iZbp1edeafcssqqrig628eZ nginx-1.10.3]# ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module --with-http_v2_module
执行以下命令:
make
完成后 然后
make install
最后在nginx conf server下配置
listen 443 ssl http2;
安装完之后 重启你的nginx ;
查看是否安装成功
打开你的网站; 查看nginx 网络请求日志;
打开你nginx log 日志; 我的是 /usr/local/nginx/logs
成功!


本文介绍了如何检查Nginx版本并安装HTTP2.0支持。首先,通过执行`./nginx -v`确认版本为1.9以上。接着,在`/usr/local/src/nginx-1.10.3`目录下使用`./configure`命令添加`--with-http_v2_module`选项。然后,运行`make`和`make install`进行编译和安装。最后,在Nginx配置文件中设置`listen 443 ssl http2;`,重启Nginx服务,并通过网站日志验证HTTP2.0是否生效。


6713

被折叠的 条评论
为什么被折叠?



