Hi, I have been banging my head on this for a few days and I realize I need a little help.
I am trying to set-up an acl that will route traffic to a site that provides a notice when all servers on a backend are down.
I followed the advice on an article called Failover and Worst Case Management with HAProxy, but it only works when you hit the site’s root. If you hit a specific path it fails. So to ensure that once the condition is met I am setting the path on the frontend to be /.
What I am trying to achieve is similar to the functionality provided in Apache’s proxyPass and proxyPassReverse. I have also followed the advice on this article, but It isn’t quite working. Depending on what I tweak, it either passes the notice back to me w/o any of the css & js that provide the formatting or the browser gets into a request loop.
Here is how things are setup.
Notices server (aka backend):
If services in
public.example.com/somepath are not available then route traffic to
acl outage_state nbsrv(public) le 1
acl url_stats path_beg -i /stats
http-request set-path / if outage_state !url_stats
use_backend notices if outage_state
# Emulate ProxyPass Reverse from Apache
acl hdr_set_cookie_path res.hdr(Set-Cookie) -m sub Path=
rspirep ^(Set-Cookie:.*)\ Path=(.*) \1\ Path=/notices if hdr_set_cookie_path