Nginx - URL 跳转
1. 当访问 https://xxx.com/ccb/xxx/xxx.html 跳转到 https://www.baidu.com 返回 301 重定向。
location /ccb/ {
return 301 https://www.baidu.com;
proxy_pass http://192.168.118.14/;
index index.html index.htm;
}
2. 当访问 https://xxx.com/ccb/activity/xxx.html 跳转到 https://www.baidu.com 返回 302 重定向。
location /ccb/ {
rewrite /ccb/activity(.*)$ https://www.baidu.com break;
proxy_pass http://192.168.118.14/;
index index.html index.htm;
}

浙公网安备 33010602011771号