HAProxy authenticated httpchk (health check)
I am using HAProxy on EC2 and using httpchk to manage node availability. I had used a pseudo-unique path as the health check route in an attempt to make sure only my servers responded to the health check. Earlier today I had an EC2 server fall out of existence, and before the haproxy config was auto-regenerated (controller issues), Amazon had reassigned the IP to someone whom 200's every request (honeypot?), my HAProxy host then pulled the server back into rotation and started distributing some of my traffic there until the controller recovered and removed the ip from the list.
TLDR;
Is there a way to add a server authentication method to HAProxy's httpchk?
Solution 1:
No, but you can use
http-check expect
Which lets you define what the response should look like.
For example:
http-check expect ! string Foo\ Bar
will only succeed if you have that string on the page.
I can't link directly in the docs, but load up http://haproxy.1wt.eu/download/1.5/doc/configuration.txt and search for "http-check expect" for more info.