Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4849

Site down Alternate Routing

$
0
0

@porton wrote:

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): notices.example.com/notices/index.html

  • Public Server:public.example.com/somepath

If services in public.example.com/somepath are not available the route traffic to notices.example.com.

Outage/Maintenance ACL

`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

Backend Configuration

backend notices
mode http

# 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

Thanks!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4849

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>