mginx配置http强制跳转https

server {
 listen 80;
 server_name xxxxxxx;
 rewrite rewrite ^(.*)$ https://$server_name$1 permanent;
}

//配置多个域名

server {
    listen 80 default_server;
    #listen [::]:80 default_server;
    server_name _;
    rewrite ^(.*)$ https://$host$1 permanent;
}

 

posted @ 2021-10-04 11:54  pengcx  阅读(75)  评论(0编辑  收藏  举报