在监听80端口的server块中,添加rewrite ^(.*) https://$server_name$1 permanent;
,具体如下:
server{
listen 80; # 支持HTTP
server_name xxx.cn;
rewrite ^(.*) https://$server_name$1 permanent;
}
2024-01-13 20:26:58
在监听80端口的server块中,添加rewrite ^(.*) https://$server_name$1 permanent;
,具体如下:
server{
listen 80; # 支持HTTP
server_name xxx.cn;
rewrite ^(.*) https://$server_name$1 permanent;
}