【发布时间】:2016-08-08 16:03:42
【问题描述】:
如果 haproxy 收到来自后端服务器的 404 响应,我正在尝试让其重定向到新位置。如果它没有收到 404,我希望它能够正常响应。
这对我来说很有意义,但似乎不起作用:
frontend front
option httplog
bind *:8080
default_backend app
backend app
balance roundrobin
acl document_request path_beg -i /documents
acl not_there status 404
http-request redirect location http://newlocation/%[path] if document_request not_there
server webserver1 10.10.10.10:8080 check
我收到以下警告:
acl 'not_there' 永远不会匹配,因为它只涉及与 'backend http-request header rule' 不兼容的关键字
我在 Centos 7 上使用的是 1.5.14 版本。
关于如何完成这项工作的任何想法?有可能做我想做的事吗?
任何帮助将不胜感激。
谢谢,
阿尔
【问题讨论】: