<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 请求会导致重定向响应。如果没有条件被指定, 重定向无条件应用
haproxy redirect location和redirect prefix
最新推荐文章于 2024-03-25 22:00:26 发布
本文详细介绍了Haproxy中redirect指令的用法,包括location、prefix和scheme三种方式,展示了如何根据不同条件实现HTTP请求的重定向,如访问特定URL或IP时的重定向,并给出了具体配置示例。
摘要由CSDN通过智能技术生成