1.前言

最近无意中看到http2.0消息,发现自己的博客虽然配了https,但并没有配置http2.0,所以搞了个玩玩,本以为配个参数就搞定了,结果还是折腾了一个小时。

2.过程

nginx并没有默认打包https2.0,所以得自行打包配置。

首先确认当前openssl版本,最低要求1.0.2,一般都不满足,所以还得手动下载openssl。nginx也用最新的稳定版。

openssl version -a

wget https://www.openssl.org/source/openssl-1.1.0e.tar.gz
wget http://nginx.org/download/nginx-1.10.2.tar.gz
#解压
tar zxf openssl-1.1.0e.tar.gz && tar zxf nginx-1.10.2.tar.gz cd nginx-1.10.2
#通过--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-1.1.0e #make过程比较长,耐心等待
make
make install

最后在nginx conf server下配置

listen 443 ssl http2;

重启nginx,查看下请求:

作者:初龙

原文链接:https://chulung.com/article/nginx-http-2-configuration

本文由MetaCLBlog于2017-07-17 09:19:21自动同步至cnblogs

本文基于 知识共享-署名-非商业性使用-禁止演绎 4.0 国际许可协议发布,转载必须保留署名及链接。

nginx HTTP/2.0 配置的更多相关文章

  1. nginx 1.14.0 配置部署 thinkphp 5.1

    开始接触NGINX,配置tp5配了半天,找不到具体原因,于是用网上搜索到的配置复制粘贴搞定. 感谢 https://blog.csdn.net/qq_36431213/article/details/ ...

  2. Ubuntu 16.04 LTS 安装配置 Nginx 1.10.0 Php7.0-FPM

    1. 安装Nginx,Php-7.0 ~$ sudo add-apt-repository ppa:nginx/stable ~$ sudo apt-get update ~$ sudo apt-ge ...

  3. nginx安全: 配置http基本验证(Basic Auth)(nginx 1.18.0)

    一,http基本验证的作用: 1,http基本身份验证会从浏览器弹出登录窗口, 简单明了,容易理解, 对于面向终端用户的前台来说,不够友好, 但对于内部员工操作的后台还是很有用,通常作为一层安全措施应 ...

  4. Nginx反向代理的配置

    Chapter: Nginx基本操作释疑 1. Nginx的端口修改问题 2. Nginx 301重定向的配置 3. Windows下配置Nginx使之支持PHP 4. Linux下配置Nginx使之 ...

  5. Ubuntu 14.04 安装最新稳定版Nginx 1.6.0

    如果已经安装,请先卸载sudo apt-get remove nginx最新的稳定版Nginx 1.6.0在ubuntuupdates ppa库中提供,网址http://www.ubuntuupdat ...

  6. ThinkPHP3.2.3 Nginx 下 URL_MODEL 的配置

    ThinkPHP3.2.3 的 URL_MODEL 包括普通模式(0).PATHINFO 模式(1).REWRITE 模式(2).兼容模式(3)等 4 种 URL 模式.在 Apache 下只要在配置 ...

  7. centos7+nginx 1.9.0+php-fpm+phpstorm+xdebug+vmware开发环境搭建

    1.php-fpm yum install php-fpm 默认配置在本地9000端口监听 service php-fpm restart启动 2.nginx 1.9.0 需先安装gcc zlib o ...

  8. nginx配置ssl双向验证 nginx https ssl证书配置

    1.安装nginx 参考<nginx安装>:http://www.ttlsa.com/nginx/nginx-install-on-linux/ 如果你想在单IP/服务器上配置多个http ...

  9. Nginx+tomcat负载均衡配置

    Nginx+tomcat是目前主流的java web架构,如何让nginx+tomcat同时工作呢,也可以说如何使用nginx来反向代理tomcat后端均衡呢?直接安装配置如下: 1.JAVA JDK ...

随机推荐

  1. display:table 表格布局

    table 布局最大的特点 1.同行等高 2.宽度自动调节   那么table-cell是不是具备这个特点呢?答案是yes,为什么呢?css中有一个有意思的规则“创建匿名表格元素”.   拿table ...

  2. React Native填坑之旅 -- 使用react-navigation代替Navigator

    Navigator已经被React Native废弃了.也许你可以在另外的一个依赖库里react-native-deprecated-custom-components里找到.不过既然官方推荐的是re ...

  3. Javascript 内核Bug

    Javascript 内核Bug: js 执行(9.9+19.8)加法运算 等于 29.700000000000003) <html> <head> <title> ...

  4. java删除数组中的第n个数

    package test; import java.util.Scanner; public class Deletearr { public static void deletearr(){ Sca ...

  5. Mybatis按顺序获取数据

    sql语句select * from producttg where hospitalcode in (1,2,3)  获取到的数据并不是按照条件1,2,3的顺序排列,如果要成下面形式(mybatis ...

  6. 为JS内置对象添加常用方法

    1.字符串全部替换: String.prototype.replaceAll = function(s1,s2){ return this.replace(new RegExp(s1,"gm ...

  7. net core 使用tagHelper将 enum枚举类型转换为下拉列表select

    [HtmlTargetElement("enums")] //[HtmlTargetElement("enums", TagStructure = TagStr ...

  8. innobackupex: fatal error: no ‘innodb_buffer_pool_filename’解决方法

    http://www.ttlsa.com/mysql/innobackupex-1-5-1-fatal-error-no-innodb_buffer_pool_filename/

  9. IIS解决CPU和内存占用率过高的问题

    发现进程中的w3wp占用率过高. 经过查询,发现如下: w3wp.exe是在IIS(因特网信息服务器)与应用程序池相关联的一个进程,如果你有多个应用程序池,就会有对应的多个w3wp.exe的进程实例运 ...

  10. MySQL阿里云安装问题小记

    1. [root@iZ2zeg11g0cdei5171kqskZ mysql]# ./scripts/mysql_install_db --user=mysql FATAL ERROR: please ...