Hi all, 

I'm trying to set up our haproxys according to the following cascaded schema: 

HTTP CLIENT: 
--> HAPROXY1 HTTP Frontend --> HAPROXY 1 Backend (/health monitoring, RR to 
Haproxy2's frontends and Haproxy3's frontends) 
--> HAPROXY2 HTTP Frontend (exposing /health monitor-uri) --> HAPROXY2 Backend 
(RR)--> Backend Servers (SITE 1) 
--> HAPROXY3 HTTP Frontend (exposing /health monitor-uri) --> HAPROXY3 Backend 
(RR)--> Backend Servers (SITE 2) 


HAPROXY1 : 
backend client-backend-name: 
mode http 
balance roundrobin 
option httpchk GET /health 
http-check expect status 200 
timeout check 6s 
server haproxy2 1.2.3.2:80 check inter 10s fall 3 rise 2 
server haproxy3 1.2.3.3:80 check inter 10s fall 3 rise 2 


HAPROXY2 & HAPROXY3 : 
frontend haproxy2-frontend-name 
mode http 
bind 1.2.3.2:80 
monitor-uri /health 
monitor fail if { nbsrv(haproxy2-backend-name) eq 0 } 
<cut> 
use_backend haproxy2-backend-name 

backend haproxy2-backend-name: 
mode http 
balance roundrobin 
option httpchk GET /health 
http-check expect status 200 
timeout check 6s 
server one 1.2.3.10:80 check inter 10s fall 3 rise 2 
server two 1.2.3.11:80 check inter 10s fall 3 rise 2 




I have set up our Haproxy2's and Haproxy3's HTTP frontends to expose the 
monitor-uri that is returning http status != 200 when all the servers in the 
provided backend are unavailable. 
I can then have the Haproxy1 know if one of them didn't have backend servers 
available to handle the request anymore. 

Now I'd want to force our monitor-uri on Haproxy2 or Haproxy3 to return http 
status != 200, just to let Haproxy1 know when we are about to shutdown the 
site/node for maintenance before the service really becomes unavailable. 
Can you please suggest me the cleanest way to have such control of monitor-uri 
returned status, forcing the http returned status to someting != 200 when 
needed and leaving it sticky to the nbsrv(backend-name) eq 0 as per default? 


Thanks, 
Matteo 

Reply via email to