haproxy redirect location和redirect prefix
<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的更多相关文章
- express url跳转(重定向)的实现:res.location() res.redirect()
Express 是一个基于Node.js 实现的web框架,其响应HTTP请求的response对象中有两个响应url跳转方法res.location() res.redirect(),可以实现301 ...
- 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 ...
- Struts2 注解模式
相信大家一定看到了两个class中定义了一样的action,不过看类的元数据,是不同的命名空间.这里比较重要(对我来说)的是 @Action(value = "/login", r ...
- express 重新加载
1,res.location() 2. res.redirect() location()与redirect()的比较: Express的response对象,是对Node.js原生对象ServerR ...
- struts2 type="redirect"源码解析
首先解释一下几个名词: request.getRequestDispatcher()是请求转发,前后页面共享一个request ; response.sendRedirect()是重新定向,前后页面不 ...
- Redirect
Redirect To use this Class, add the following to the top of the file. use Redirect; Redirect::to($pa ...
- jsp中forward与redirect
一.调用方式 我们知道,在servlet中调用转发.重定向的语句如下: request.getRequestDispatcher("new.jsp").forward(reques ...
- Flask:redirect()函数
Windows 10家庭中文版,Python 3.6.4,Flask 1.0.2 重定向,就是在客户端提交请求后,本来是访问A页面,结果,后台给了B页面,当然,B页面中才有需要的信息. 在Flask中 ...
- Ajax 如何执行 Response.Redirect
Ajax 直接对服务端的Response.Redirect是不感冒的, 另觅途径, 具体可行办法如下: Web Service 服务端: public WXService() { if (!IsVal ...
随机推荐
- JVM -- 类加载
学习自周志明老师的<深入理解Java虚拟机>第二版 类的加载时机 如上图所示: 类从被加载到虚拟机内存中开始,直到卸载出内存为止,它的整个生命周期包括了: 加载.验证.准备.解析.初始化. ...
- HDU 5012 Dice DFS
简单DFS //#pragma comment(linker, "/STACK:16777216") //for c++ Compiler #include <stdio.h ...
- Android学习笔记:FrameLayout布局基础
FrameLayout布局的特点是:所有放在布局里的视图组件,都按照层次堆叠在屏幕的左上角,后面的视图组件覆盖前面的. 当然,组件本身是可以控制自己的内部布局的. 一种常见的场景是可以在FrameLa ...
- 数据库中操作XML(openXML)
最近公司项目需要在数据库中操作XML,因此系统的学习了一下 一.openxml的格式 OPENXML( idoc int [ in] , XPathnvarchar [ in ] , [ flags ...
- 基于visual Studio2013解决算法导论之044最短路径
题目 最短路径 解决代码及点评 // 26最短路径dijstra.cpp : 定义控制台应用程序的入口点. // #include <iostream> using namespa ...
- E. Riding in a Lift(Codeforces Round #274)
E. Riding in a Lift time limit per test 2 seconds memory limit per test 256 megabytes input standard ...
- 编程算法 - 扑克牌的顺子 代码(C)
扑克牌的顺子 代码(C) 本文地址: http://blog.csdn.net/caroline_wendy 题目: 从扑克牌中随机抽取5张牌, 推断是不是一个顺子, 即这5张牌是不是连续的. 2~1 ...
- 嵌入式MCU开发群资源
STM32CubeMX是一款图形化软件设置工具,允许使用图形化向导来生成C初始化代码.它是未来开发stm32系列产品的主流软件,是ST公司的主动原创,可以减轻开发工作,时间和费用.STM32Cube ...
- File类常见方法
package file; import java.io.File; public class FileTest2 { public static void main(String[] args) { ...
- C-KMP
一.BF算法 --传统算法 BF算法是普通的模式匹配算法,BF算法的思想就是将目标串S的第一个字符与模式串P的第一个字符进行匹配,若相等,则继续比较S的第二个字符和P的第二个字符:若不相等,则比较S的 ...