网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

让我们的站点支持http2|nginx支持http2

之前写过Ubuntu如何安装nginx:https://blog.51cto.com/11140372/2335820
这里看如何将站点改成http2(http2的好处不言而喻,自行百度):

成都创新互联专业为企业提供北川羌族网站建设、北川羌族做网站、北川羌族网站设计、北川羌族网站制作等企业网站建设、网页设计与制作、北川羌族企业网站模板建站服务,10余年北川羌族做网站经验,不只是建网站,更提供有价值的思路和整体网络服务。


wget https://github.com/openssl/openssl/archive/OpenSSL_1_1_1a.tar.gz
tar zxvf OpenSSL_1_1_1a.tar.gz

cd nginx-1.15.8/
#通过--with-http_v2_module 打包http2 --with-openssl指定openssl目录
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module --with-http_v2_module --with-openssl=../openssl-OpenSSL_1_1_1a
make -j2

sudo make install 
#最后在nginx conf server下配置

listen 443 ssl http2;
server_name  localhost;

ssl_certificate_key /home/anfang/Downloads/cert/key.pem;
ssl_certificate   /home/anfang/Downloads/cert/cert.pem;

这是我配置laravel的nginx配置文件,现在改成了http2的:
看我之前laravel的配置过程:https://blog.51cto.com/11140372/2335680
让我们的站点支持http2|nginx支持http2
到这里重启nginx,然后访问页面:https://yourip 即可。我的Chrome浏览器的版本支持http2。
如何判断网站是否使用了HTTP/2:https://blog.csdn.net/Edu_enth/article/details/85318840

其中的key.pem和cert.pem自己可以通过openssl生成。或者下载我的:http://down.51cto.com/data/2457495


当前名称:让我们的站点支持http2|nginx支持http2
网站URL:http://bjjierui.cn/article/jjhscg.html

其他资讯