<pre name="code" class="html">redirect location <loc> [code <code>] <option> [{if | unless} <condition>]
redirect prefix <pfx> [code <code>] <option> [{if | unless} <condition>]
redirect scheme <sch> [code <code>] <option> [{if | unless} <condition>]
Return an HTTP redirection if/unless a condition is matched
May be used in sections : defaults | frontend | listen | backend
no | yes | yes | yes If/unless the condition is matched, the HTTP request will lead to a redirect
response. If no condition is specified, the redirect applies unconditionally. 如果/除非 条件被匹配,HTTP 请求会导致重定向响应。如果没有条件被指定, 重定向无条件应用 Arguments :
<loc> With "redirect location", the exact value in <loc> is placed into
the HTTP "Location" header. When used in an "http-request" rule,
<loc> value follows the log-format rules and can include some
dynamic values (see Custom Log Format in section 8.2.4). 使用重定向位置, 准确的值在<loc> 是被放入到HTTP"Location" header. 用于"http-request" rule, <loc> 值 遵循 log-format rules 包含一些动态值 mode http
acl being_scanned be_sess_rate gt 100
redirect location /denied.html if being_scanned #用法三、当用户访问172.16.1.100时,重定向到http://www.afwing.com
acl dstipaddr hdr(Host) 172.16.1.100
redirect location http://www.afwing.com if dstipaddr acl host_wx.cn hdr(Host) 120.55.118.6
redirect location http://wechatTest.winfae.com/index.html if host_wx.cn 访问 120.55.118.6 跳转到http://wechatTest.winfae.com/index.html 重定向到一个路径 <pfx> With "redirect prefix", the "Location" header is built from the
concatenation of <pfx> and the complete URI path, including the
query string, unless the "drop-query" option is specified (see
below). As a special case, if <pfx> equals exactly "/", then
nothing is inserted before the original URI. It allows one to
redirect to the same URL (for instance, to insert a cookie). When
used in an "http-request" rule, <pfx> value follows the log-format
rules and can include some dynamic values (see Custom Log Format
in section 8.2.4). 重定向前缀,the "Location" header是建立在<pfx> 相关的和完整的URI 路径, 包含查询的字符串,除非 "drop-query"选项被指定(参见下面) 作为一个特殊的例子, 如果 <pfx> 等于 /,那么什么业不会插入在原始的URI前。 它会允许重定向到相同的URL(比如,插入cookie). 当使用在 http-request 规则, <pfx> 遵循 log-format
rules 和 包含一些动态值
acl short_dom hdr(Host) -i etiantian.org
redirect prefix http://php.etiantian.org code 301 if short_dom
目的:使访问http://etiantian.org 跳转到http://php.etiantian.org acl host_wx2.cn hdr(Host) -i wechatTest.winfae.com
redirect prefix http://wechatTest.winfae.com/index.html if host_wx2.cn http://wechattest.winfae.com/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/ 原因 wechatTest.winfae.com 匹配到这个就重定向到http://wechatTest.winfae.com/index.html ,导致写了多个Index.html
												

haproxy redirect location和redirect prefix的更多相关文章

  1. express url跳转(重定向)的实现:res.location() res.redirect()

    Express 是一个基于Node.js 实现的web框架,其响应HTTP请求的response对象中有两个响应url跳转方法res.location() res.redirect(),可以实现301 ...

  2. struts2 CVE-2013-2251 S2-016 action、redirect code injection remote command execution

    catalog . Description . Effected Scope . Exploit Analysis . Principle Of Vulnerability . Patch Fix 1 ...

  3. Struts2 注解模式

    相信大家一定看到了两个class中定义了一样的action,不过看类的元数据,是不同的命名空间.这里比较重要(对我来说)的是 @Action(value = "/login", r ...

  4. express 重新加载

    1,res.location() 2. res.redirect() location()与redirect()的比较: Express的response对象,是对Node.js原生对象ServerR ...

  5. struts2 type="redirect"源码解析

    首先解释一下几个名词: request.getRequestDispatcher()是请求转发,前后页面共享一个request ; response.sendRedirect()是重新定向,前后页面不 ...

  6. Redirect

    Redirect To use this Class, add the following to the top of the file. use Redirect; Redirect::to($pa ...

  7. jsp中forward与redirect

    一.调用方式 我们知道,在servlet中调用转发.重定向的语句如下: request.getRequestDispatcher("new.jsp").forward(reques ...

  8. Flask:redirect()函数

    Windows 10家庭中文版,Python 3.6.4,Flask 1.0.2 重定向,就是在客户端提交请求后,本来是访问A页面,结果,后台给了B页面,当然,B页面中才有需要的信息. 在Flask中 ...

  9. Ajax 如何执行 Response.Redirect

    Ajax 直接对服务端的Response.Redirect是不感冒的, 另觅途径, 具体可行办法如下: Web Service 服务端: public WXService() { if (!IsVal ...

随机推荐

  1. net core开发环境准备

    net core开发环境准备 1.1  安装sdk和运行时 浏览器打开网址https://www.microsoft.com/net/download, 到.Net Core下载页面. 根据操作系统, ...

  2. poj2676解题报告

    题意:有一个9*9的格子 分成了9个3*3的小子格,一些位置上的已有一些数字..现在要求你把没有数字的位置填上数,要求这个数没有出现在这个位置所在的行.列以及所在的子格 分析: 那么我们对于所有的未填 ...

  3. objective-C 初识

    objective-C objective-c 是c语言的改进版 一.方法的定义: 格式: -/+(返回值类型)方法名:(参数类型) 参数名 [方法名] : (参数类型) 参数名......... 例 ...

  4. Android新增API之AudioEffect中文API与应用实例

    在Android2.3中增加了对音频混响的支持,这些API包含在android.media.audiofx包中. 一.概述 AudioEffect是android audio framework(an ...

  5. sql基础,必须会的————随便整理、杂乱无章

    1.sqlserver2008r2的安装 2.数据库与表的建立.增加.删除.修改. 3,索引的概念,包括聚集与非聚集的区别.全文索引的建立与如何使用全文索引. 4,重新生成索引,重新组织索引. 5,建 ...

  6. 演练5-6:Contoso大学校园管理系统6

    在上一次的教程中,我们处理了关联数据问题.这个教程演示如何处理并发问题.你将使用Department实体创建一个页面,这个页面在支持编辑和删除的同时,还可以处理并发错误.下面的截图演示了Index页面 ...

  7. java 泛型详解(普通泛型、 通配符、 泛型接口)

    java 泛型详解(普通泛型. 通配符. 泛型接口) JDK1.5 令我们期待很久,可是当他发布的时候却更换版本号为5.0.这说明Java已经有大幅度的变化.本文将讲解JDK5.0支持的新功能---- ...

  8. Ibatis2.3.4的一个bug

    java.lang.ClassCastException: com.chat.upgrade.domain.ClientFile cannot be cast to java.lang.String ...

  9. Amlogic开关机按键功能实现

    在做AMlogic项目的时候,配置按键后,发现电源键仅仅能关机,不能开机,非常是郁闷 后来发现是漏掉了一个地方没有配置,firmware/arc_power/irremote2arc.c 这个文件中面 ...

  10. 关于callContext

    coding们肯定有这种需求,在程序中,方法一级级调下去,比如A->b->C->D.... ->Z.在调用过程中,希望在调用函数之间传递一些数据,常见的是将特定的数据从高往低处 ...