修改/etc/nginx/nginx.conf 文件,增加配置:
https{}下:
server{
listen 80;
listen [::]:80 ssl ipv6only=on; //支持ipv6
listen 443 ssl;
listen [::]:443 ssl ipv6only=on;
listen [::]:80 ssl ipv6only=on; //支持ipv6
listen 443 ssl;
listen [::]:443 ssl ipv6only=on;
server_name zs.saicmg.com; //域名
ssl on;
ssl_certificate /etc/ssl/private/ saicmotor.com .crt; //证书路径
ssl_certificate_key /etc/ssl/private/ saicmotor.com .key;
}
配置完成后重启nginx 服务。
nginx -s reload