1.首页跳转:
rewrite "^/$" https://www.frost.net.cn/wprdpress/index break;
2.请求跳转
rewrite ^(.*)$ https://$host$1 permanent
3.添加单个例外(不能与2同时使用)
if ($request_uri !~* .*/upload/resource ) { return 301 https://$server_name$request_uri; }
4.添加多个例外(不能与2同时使用)
set $a 0; if ($request_uri ~* .*/upload/resource ) { set $a 1; } if ($request_uri ~* /abc/abc ) { set $a 1; } if ( $a = 0 ){ return 301 https://$server_name$request_uri; }