server {
listen 80;
listen 443 ssl;
server_name api.xmzhishang.cn;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
ssl_certificate /www/sites/cert/4622709_api.xmzhishang.cn.pem; #将domain name.pem替换成您证书的文件名称。
ssl_certificate_key /www/sites/cert/4622709_api.xmzhishang.cn.key; #将domain name.key替换成您证书的密钥文件名称。
ssl_prefer_server_ciphers on;
#自动跳转到HTTPS (可选)
if ($server_port = 80) {
rewrite ^(.*)$ https://$host$1 permanent;
}
location / {
root /www/sites/public/;
index index.php;
include enable-php-70.conf;
include /www/server/panel/vhost/rewrite/site.xmzhishang.cn.conf;
}
}