最简单的方式,使用rewrite重写到https
server {
listen 80;
charset utf-8;
server_name www.test.com;
location ~ ^/(.*) {
rewrite ^/(.*) https://www.test.com/$1 permanent;
}
}
参考
https://www.cnblogs.com/yun007/p/3739182.html