nginx官网下在nginx http://nginx.org/en/download.html在这里插入图片描述
在这里插入图片描述
双击 启动服务
下载OpenSSL
http://slproweb.com/products/Win32OpenSSL.html
在这里插入图片描述
下载完成安装到
C:\OpenSSL-Win64
OPENSSL_HOME 变量,值为 C:\OpenSSL-Win64openssl genrsa -des3 -out 2_www.p2pi.cn.key 1024 // 2_www.p2pi.cn 自己取的名字openssl req -new -key shidian.key -out 1_www.p2pi.cn_bundle.csr
2_www.p2pi.cn.key重命名为2_www.p2pi.cn.key.org
openssl rsa -in 2_www.p2pi.cn.key.org -out 2_www.p2pi.cn.keyopenssl x509 -req -days 365 -in 1_www.p2pi.cn_bundle.csr -signkey 2_www.p2pi.cn.key -out 1_www.p2pi.cn_bundle.crt腾讯免费ssl证书获取链接:https://console.cloud.tencent.com/ssl
注意:申请时若未在腾讯云上进行实名认证,则会先跳转到实名认证。
下面为免费申请页面,默认可以使用1年。
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
参考网址:https://cloud.tencent.com/document/product/400/4142
在这里插入图片描述
在这里插入图片描述
要在nginx中配置https,就必须安装ssl模块,也就是: http_ssl_module 。
./configure \--prefix=/usr/local/nginx \--pid-path=/var/run/nginx/nginx.pid \--lock-path=/var/lock/nginx.lock \--error-log-path=/var/log/nginx/error.log \--http-log-path=/var/log/nginx/access.log \--with-http_gzip_static_module \--http-client-body-temp-path=/var/temp/nginx/client \--http-proxy-temp-path=/var/temp/nginx/proxy \--http-fastcgi-temp-path=/var/temp/nginx/fastcgi \--http-uwsgi-temp-path=/var/temp/nginx/uwsgi \--http-scgi-temp-path=/var/temp/nginx/scgi \--with-http_ssl_modulemakemake installserver {listen 443;server_name www.p2pi.cn;# 开启sslssl on;# 配置ssl证书ssl_certificate 1_www.p2pi.cn_bundle.crt;# 配置证书秘钥ssl_certificate_key 2_www.p2pi.cn.key;# ssl会话cachessl_session_cache shared:SSL:1m;# ssl会话超时时间ssl_session_timeout 5m;# 配置加密套件,写法遵循 openssl 标准ssl_protocols TLSv1 TLSv1.1 TLSv1.2;ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;ssl_prefer_server_ciphers on;location / {proxy_pass http://tomcats/;原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。