Nginx开启强制HTTPS访问并保留指定目录的HTTP访问代码

   #HTTP_TO_HTTPS_START
    if ($server_port !~ 443){
        rewrite ^/((?!wp-admin).*)$ https://www.jiangdefu.com/$1 permanent;
    }
    #HTTP_TO_HTTPS_END
 

发表评论