nginx搭建https+http2

建站服务器

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;

openssl genrsa -out key.pem 2048

openssl req -new -x509 -sha256 -key key.pem \\
 -out cert.pem -days 36500 \\
 -subj /C=CN/ST=Shanghai/L=Songjiang/O=ztgame/OU=tech/CN=mydomain.ztgame.com/emailAddress=myname@ztgame.com

openssl x509 -in cert.pem -noout -text

标题名称:nginx搭建https+http2
文章转载:http://bzwzjz.com/article/cpopss.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 成都定制网站建设 响应式网站设计 成都网站建设流程 成都定制网站建设 成都网站制作 外贸营销网站建设 营销型网站建设 公司网站建设 成都网站建设 成都网站设计 营销型网站建设 成都网站建设 网站制作报价 成都企业网站建设 成都响应式网站建设公司 专业网站设计 成都营销网站建设 成都网站建设 手机网站制作 企业网站设计 响应式网站设计方案 网站建设方案