千家信息网

nginx搭建https+http2

发表于:2025-12-03 作者:千家信息网编辑
千家信息网最后更新 2025年12月03日,wget https://github.com/openssl/openssl/archive/OpenSSL_1_1_1a.tar.gztar zxvf OpenSSL_1_1_1a.tar.gzc
千家信息网最后更新 2025年12月03日nginx搭建https+http2
wget https://github.com/openssl/openssl/archive/OpenSSL_1_1_1a.tar.gztar zxvf OpenSSL_1_1_1a.tar.gzcd 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_1amake -j2sudo 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 2048openssl 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.comopenssl x509 -in cert.pem -noout -text
0