1、增加端口号443
listen 80;
listen 443;
2、修改配置文件
ssl on;
ssl_certificate_key /data/apps/*.key;
ssl_certificate /data/apps/*.crt;
3、配置nginx的conf ,所有都要求访问https
location / {
rewrite ^/(.*) https://*.com/$1 permanent ;
}
或者
if ($scheme = http) {
return 301 https://$server_name$request_uri;
}