nginx中http强制跳https

  sre

5fd2218194a64526.png_fo742.png

rewrite

server {
        listen 80;
        server_name test.com www.test.com;
        #rewrite ^(.*)https://host1 permanent;
        rewrite ^(.*)  https://test.com$1 permanent;
}

301

server {
        listen 80;
        server_name test.com www.test.com;
        return 301 https://server_namerequest_uri;

}

LEAVE A COMMENT

Captcha Code