在nginx配置文件中改为如下 (以下属性中ssl开头的属性与证书配置有直接关系,其它属性请结合自己的实际情况复制或调整) :
server {
listen 80;
server_name www.jado.vip jado.vip;
return 301 https://www.jado.vip$request_uri;
}
server {
listen 443;
server_name www.jado.vip jado.vip;
ssl on;
ssl_certificate cert/1798189_jado.vip.pem; // 证书
ssl_certificate_key cert/1798189_jado.vip.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;
index html/jado.html;
location / {
root /opt/project/jado/WebRoot/;
}
access_log /var/log/nginx/jado.log;
}
把上面jado
或者jado.vip
改为你的域名;证书改为自己的证书名称;
原文地址:http://blog.51cto.com/moerjinrong/2349720
时间: 2024-11-04 03:07:23