前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Nginx结构全解析(50)

Nginx结构全解析(50)

原创
作者头像
陈不成i
修改2021-05-13 14:46:07
2460
修改2021-05-13 14:46:07
举报
文章被收录于专栏:ops技术分享ops技术分享

示例2

  1. # http://www.test.com/test/abc/1.html ⇒ http://www.test.com/ccc/bbb/2.html
  2. location /test {
  3. rewrite .* /ccc/bbb/2.html permanent;
  4. }
  5. # http://www.test.com/2015/ccc/bbb/2.html ==> http://www.test.com/2014/ccc/bbb/2.html
  6. location /2015 {
  7. rewrite ^/2015/(.*)$ /2014/$1 permanent;
  8. }
  9. # http://www.test.com/2015/ccc/bbb/2.html ==> http://jd.com/index.php
  10. location /2015 {
  11. if ($host ~* test.com) {
  12. rewrite .* http://www.jd.com/index.php permanent;
  13. }
  14. }
  15. # http://www.test.com/kkk/1.html ==> http://jd.com/kkk/1.html
  16. location / {
  17. root html;
  18. index index.html index.htm;
  19. if ($host ~* test.com) {

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档