在监听80端口的server块中,添加rewrite ^(.*) https://$server_name$1 permanent;
,具体如下:
server{
listen 80; # 支持HTTP
server_name xxx.cn;
rewrite ^(.*) https://$server_name$1 permanent;
}
标签:http,name,rewrite,server,permanent,https,跳转,80
来源: https://blog.csdn.net/weixin_38106322/article/details/117965047