// 网站ssl证书https教程 主要是下面ssl on 和下面的 ssl_certificate ssl_certificate_key 对准路径即可
charset utf-8;
listen 443;
client_max_body_size 128M;
# listen 9999;
#绑定的网站
#server_name www.html7.top;
server_name www.santant.top;
#项目的目录
ssl on;
# root /data/www/tp/public;
ssl_certificate /data/www/cert/cert-1523944861629_www.santant.top.crt;
ssl_certificate_key /data/www/cert/cert-1523944861629_www.santant.top.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;
http和https公用1个域名
// http和https同时开启
server {
listen 80;
server_name www.santant.top; #你的域名
rewrite ^(.*)$ https://$host$1 permanent; #把http的域名请求转成https
}