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
來源:簡書
簡書著作權歸作者所有,任何形式的轉載都請聯繫作者獲得授權並註明出處。