nginx配置ssl注意的地方(nginx配置ssl)
admin2024-08-14 10:15:16Linux运维
server {
listen 443 ssl; //应该是nginx1.10以上的版本使用
server_name www.shnne.com;
root /data/web/kart;
index index.html index.htm;
#ssl on; //低于1.10用ssl on
ssl_certificate /data/web/key/shnne.crt;
ssl_certificate_key /data/web/key/shnne.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 / {
index index.html index.htm;
}
}
server {
listen 80;
server_name www.shnne.com;// 你的域名
rewrite ^(.*)$ https://$host$1 permanent;// 把http的域名请求转成https}
nginx -t
nginx -s reload