I'm trying to get haproxy to redirect to a new location if it receives a 404 response from a backend server. If it does not receive a 404, I would like it to respond normally.
This made sense to me, but doesn't seem to work:
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
I received the following warning:
acl 'not_there' will never match because it only involves keywords that are incompatible with 'backend http-request header rule'
I'm using version 1.5.14 on Centos 7.
Any ideas on how to make this work? Is it possible to do what I am trying to do?
Any assistance would be greatly appreciated.
Thanks,
AL