首页 > 其他 > 详细

017_nginx重定向需求

时间:2017-09-11 19:00:53      阅读:253      评论:0      收藏:0      [点我收藏+]

重定向的各种需求

需求一、

前端同事需要把特定的url进行重定向,实现如下:

location  / {
    root /data/base.apiportal_opsweb;
    index index.html index.htm;
    if ($request ~ product|api){          #url中包含product或api的都进行跳转
        rewrite /(.*) /index.html break;  #原始的请求url还在,但实际已经重定向到新的访问地址了
    }
}

需求二、

 

017_nginx重定向需求

原文:http://www.cnblogs.com/itcomputer/p/7506381.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!