码迷,mamicode.com
首页 > Web开发 > 详细

nginx支持http2

时间:2018-05-18 14:19:17      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:config   style   链接   png   指令   技术   执行   使用   com   

前提

  1. nginx  >= 1.9.14
  2. openssl >= 1.0.2

编译

./configure --with-http_v2_module --with-openssl=/home/app/openssl-1.0.2o --with-debug

新增--with-http_v2_module --with-openssl=/home/app/openssl-1.0.2o编译指令,注意with-openssl 为openssl的源代码目录。

若工程遵循nginx的开发模式,且具备config配置文件,nginx会将该源代码编译成模块,并链接到自身的二进制可执行文件中。

配置

listen 指令中增加http2

技术分享图片 

http2 标准并没有规定使用https,但是现行的浏览器不支持没有加密的http2,所以使用https成了事实标准。

验证

技术分享图片

 

http://nginx.org/en/docs/http/ngx_http_v2_module.html

nginx支持http2

标签:config   style   链接   png   指令   技术   执行   使用   com   

原文地址:https://www.cnblogs.com/nginx-core/p/9055161.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!