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;
}

 

相关文章:

  • 2021-07-07
  • 2022-12-23
  • 2021-09-12
  • 2022-02-07
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-14
  • 2022-12-23
相关资源
相似解决方案