nginx1.18支持http2.0

个人学习笔记,谢绝转载!!!

原文:https://www.cnblogs.com/wshenjin/p/13522388.html


nginx并没有默认支持https2.0,需要自行编译安装
openssl版本,最低要求1.0.2

安装

[root@ ~]# wget https://www.openssl.org/source/openssl-1.1.1a.tar.gz
[root@ ~]# tar xf openssl-1.1.1a.tar.gz

[root@ ~]# wget http://nginx.org/download/nginx-1.18.0.tar.gz
[root@ ~]# tar xf nginx-1.18.0.tar.gz 
[root@ ~]# cd nginx-1.18.0
[root@ nginx-1.18.0]# ./configure  *** --with-http_v2_module  --with-openssl=../openssl-1.1.1a/

配置

listen 443  ssl http2;

curl支持http2

[root@ ~]# wget https://github.com/nghttp2/nghttp2/releases/download/v1.41.0/nghttp2-1.41.0.tar.bz2 
[root@ ~]# tar xf nghttp2-1.41.0.tar.bz2 
[root@ ~]# cd nghttp2-1.41.0
[root@ ~]# autoreconf  -i 
[root@ ~]# automake
[root@ ~]# autoconf  
[root@ ~]# ./configure --prefix=/usr/local/nghttp2-1.41.0
[root@ ~]# make && make install 

[root@ ~]# wget http://curl.haxx.se/download/curl-7.46.0.tar.bz2
[root@ ~]# tar xf curl-7.46.0.tar.bz2 
[root@ ~]# cd curl-7.46.0 
[root@ ~]# ./configure --with-nghttp2=/usr/local/nghttp2-1.41.0/ --with-ssl  --prefix=/usr/local/curl-7.46.0/
[root@ ~]# make && make install
[root@ ~]# /usr/local/curl-7.46.0/bin/curl --version
curl 7.46.0 (x86_64-pc-linux-gnu) libcurl/7.46.0 OpenSSL/1.0.2k zlib/1.2.7 nghttp2/1.41.0
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: IPv6 Largefile NTLM NTLM_WB SSL libz HTTP2 UnixSockets 
posted @ 2020-08-18 11:12  wshenJin  阅读(801)  评论(0编辑  收藏  举报