nginx配置http2无效不起作用
来源:互联网 发布:高校教学软件租赁 编辑:程序博客网 时间:2024/06/10 00:26
最近博客打算做https顺便把http2也做上去,但是测试的时候发现还是http/1.1,问题出来哪里?
nginx -V 查看编译参数也带有 –with-http_v2_module 默认情况下http_v2_module是自动带着的Google 了一下发现是 OpenSSL 版本的问题OpenSSL 1.0.1e的版本不支持ALPN,所以无法开启 HTTP2
问题已经找到开始怎么解决问题更新openssl
wget --no-check-certificate https://www.openssl.org/source/openssl-1.0.2j.tar.gztar zxvf openssl-1.0.2j.tar.gzcd openssl-1.0.2j./config shared zlibmake && make installmv /usr/bin/openssl /usr/bin/openssl.oldmv /usr/include/openssl /usr/include/openssl.oldln -s /usr/local/ssl/bin/openssl /usr/bin/opensslln -s /usr/local/ssl/include/openssl /usr/include/opensslecho "/usr/local/ssl/lib" >> /etc/ld.so.confldconfig -v查看openssl版本
openssl version安装之后目标的版本是
重新编译nginx
nginx -V
目前nginx中的openssl还没有修改过了,需要重新编译一下,保持上面图中的configure arguments,也就是编译参数,重新编译的时候需要用到
我的nginx版本是1.10.0,从官网上下载wget http://nginx.org/download/nginx-1.10.0.tar.gztar zxvf nginx-1.10.0.tar.gzcd nginx-1.10.0修改加载openssl 方式
vi auto/lib/openssl/confCORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"改为:CORE_INCS="$CORE_INCS $OPENSSL/include"CORE_DEPS="$CORE_DEPS $OPENSSL/include/openssl/ssl.h"CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libssl.a"CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libcrypto.a"重新编译nginx
上面编制的参数中添加–with-openssl参数
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-ipv6 --with-http_sub_module --with-openssl=/usr/local/ssl修改nginx
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.oldservice nginx stop
PS.如果不停止nginx没有办法覆盖,会提示cp -f ./objs/nginx /usr/local/nginx/sbin/service nginx start最后查看一下nginx openssl是否已经更新
nginx -V
QQ交流群:136351212
查看原文:
0 0
- nginx配置http2无效不起作用
- nginx http2配置
- Nginx 上配置 HTTP2
- nginx 配置http2.0
- nginx配置http2,chrome还是显示h1.1解决办法
- nginx+http2+https
- nginx https http2
- nginx http2 源码分析
- nginx配置貌似正确,但不起作用
- nginx配置支持ssi不起作用问题解决办法
- Ubuntu 配置 Nginx http2.0 支持 (二) 编译&配置Nginx 与 pagespeed
- Tomcat9配置HTTP2
- nginx 1.9 支持http2 协议
- Nginx上部署HTTPS + HTTP2
- 或许是 Nginx 上配置 HTTP2 最实在的教程了
- 解决Nginx配置http2不生效,谷歌浏览器仍然采用http1.1协议问题
- 样式不起作用 css无效
- filter 无效不起作用
- 【机房重构】——七层登陆
- java Queue接口简介
- ***POJ 3614 Sunscreen
- com.google.code.findbugs引起的错误
- Linphone callState 电话状态的监听状态(二)
- nginx配置http2无效不起作用
- 安装完成服务器进行优化
- css-position:absolute时如何居中
- 理解Jquery的first-of-type选择器
- 2017LinuxPHP+Mysql+nginx最详尽配置学习手册包括优化
- windows网络模型
- 冒泡排序和改进
- Ubuntu调教手册(软件安装sogou,chrome等)
- git commit message 工程实践