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