you can try 'use_backend' with ACL.

for example you can config two backends named be1 and be2.
then:
acl a1 path_reg "some_regex1"
acl a2 path_reg "some_regex2"
use_backend be1 if a1
use_backend be2 if a2

if you carefully design the regex1 and regex2, it will work fine.
notice that if be1 is down, half of the requests will fail. (can't switch to 
be2)


From: Sachin Shetty
Date: 2012-02-22 18:49
To: haproxy@formilux.org
Subject: Grouping servers for failover within a backend
Hi,
 
We have four web servers in a single backend. Physically these four servers are 
on two different machines. A new sessions is made sticky by hashing on one of 
the headers. 
 
Regular flow is ok, but when one of the webservers are down for an in-flight  
session, the request should be re-dispatched to the webserver on the same 
machine if available. I looked at various options in the config, but couldn't 
figure out a way to do it.  Has anybody achieved any thing similar with some 
config tweaks?
 
 
Thanks
Sachin

Reply via email to