nginx rewrite
1.www跳转不带www
if ( $host != 'xx.com' ){
rewrite ^/(.*)$ http://xx.com/$1 permanent;
}
2.指定页面跳转http,其他页面跳转https
vim xx.conf
if ( $request_uri !~ 'abc.html|def.html' ){
rewrite ^/(.*)$ https://xx.com/$1 permanent;
}
vim xx_https.conf
if ( $request_uri ~ 'abc.html|def.html' ){
rewrite ^/(.*)$ http://xx.com/$1 permanent;
}