nginx配置https
- 由于使用了阿里云https证书,故该步骤参照了阿里云教程,将从阿里云上下载下来的证书保存到cert文件夹下,并将该文件夹放到nginx的conf文件夹下,并将以下配置添加:
server {
listen 443;
server_name localhost;
ssl on;
root html;
index index.html index.htm;
ssl_certificate cert/xxx.pem;
ssl_certificate_key cert/xxx.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
root html;
index index.html index.htm;
}
}
作者:sweetMemories
链接:https://www.jianshu.com/p/5a57d1bea859
來源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。