Reputation: 1021
I have a website served by several machines behind a haproxy loadbalancer. Now it use sticky sessions based on cookies. I'm using a uptimerobot to check the machines health but I cannot configure it to use cookies and I don't want the loadbalancer to be the only open point to the internet.
Is there a way to configure the load balancer to access the machines by a url parameter?
Upvotes: 1
Views: 123
Reputation: 1761
There is a way but it isn't advisable. In the config, create duplicate backend blocks and url_param
-based ACLs to route requests to specific servers based on a URL parameter.
Example:
frontend fe
bind x.x.x.x:80
bind x.x.x.x:443 ssl crt.. blah
...
default_backend www
acl is_healthchk_s1 url_param(CHECK) -i s1
acl is_healthchk_s2 url_param(CHECK) -i s2
acl is_healthchk_sn url_param(CHECK) -i sn
use_backend be_healthchk_s1 if is_healthchk_s1
use_backend be_healthchk_s2 if is_healthchk_s2
use_backend be_healthchk_sn if is_healthchk_sn
backend www
server s1 x.x.x.x:8080 check
server s2 x.x.x.x:8080 check
server sn x.x.x.x:8080 check
backend be_healthchk_s1
server s1 x.x.x.x:8080 check
backend be_healthchk_s2
server s2 x.x.x.x:8080 check
backend be_healthchk_s3
server s3 x.x.x.x:8080 check
So, your uptime robot can check these instead:
Upvotes: 1