• nginx 配置重定向及nginx配置if


    需求:
    地址
    http://testa/inlinePreview/live.html?id=463738305721405440
    重定向到
    http://testb/shares/live.html?newsId=463738305721405440 break;

    nginx配置:
    在testa的nginx中配置
    if ($request_uri = /inlinePreview/live.html?id=463738305721405440){
      rewrite ^ http://testb/shares/live.html?newsId=463738305721405440 break;
    }
    请求http://testa/inlinePreview/live.html?id=463738305721405440在nginx中$request_uri为去掉http://testa的部分
    即/inlinePreview/live.html?id=463738305721405440

    nginx配置if and方法:
    set $a 0;
    if ($request_uri ~ id=376332472792911872$){ #以id=376332472792911872结尾
      set $a 1;
    }
    if ($request_uri ~ ^/inlinePreview){ #以/inlinePreview开头
      set $a 1$a;
    }
    if ($a = 11 ){
      rewrite ^ http://news.bandaoapp.com/shares/live.html?newsId=376332472792911872 break;
    }

  • 相关阅读:
    项目管理原则
    开发规范
    讲故事-如何才算确认了需求
    关于概要设计
    jQuery操作
    IE8,IE9,IE10绿色版,以及ColorPix
    机务UI设计小节
    Abstract Factory
    Flyweight
    Chain of Responsibility
  • 原文地址:https://www.cnblogs.com/robertsun/p/12994595.html
Copyright © 2020-2023  润新知