Hi all,
I have configured haproxy using the below configuration. No matter
what URL I browser to I always receive a HTTP 200 response to my
browser. If I comment out the ACL and three monitor lines from the
frontend configuration, normal behaviour is resumed. I have that gut
feeling that I have done something obviously wrong, but I can't spot
it :)
Where am I going wrong with this? I assume that haproxy captures
requests to /checkuri and sends back HTTP 200 when at least 2 back end
servers are up (which they are, I can see the requests coming into
them) and 503 when one or more is down. Otherwise, all other requests
are passed directly to the back end servers. It seems to be
intercepting whatever URI I request via GET and returns HTTP 200 OK,
nothing reaches the back end servers when the monitor URI is
configured.
frontend monitor-http-servers
bind 1.2.3.4:80
acl backend_down nbsrv(http--servers) lt 2 # HAProxy can see
lee than 2 backend servers
monitor-uri /checkuri
monitor-net 172.22.0.0/24
monitor fail if backend_down
default_backend http--servers
backend http-servers
cookie cook insert
option persist
option redispatch
server cook1 192.168.0.1:80 cookie c1 check inter 2000 rise 3 fall 3
server cook2 192.168.0.2:80 cookie c2 check inter 2000 rise 3 fall 3
balance roundrobin
Cheers,
James.