nginx http跳https

if ( $scheme = "http" ){
rewrite ^(.*)$ https://$host$1 permanent;
}

 

http状态码301和302

 

官方的比较简洁的说明:

        301 redirect: 301 代表永久性转移(Permanently Moved)

        302 redirect: 302 代表暂时性转移(Temporarily Moved )

你可能感兴趣的