5

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?

Markel
  • 51
  • 2

2 Answers2

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.

jedberg
  • 2,301
  • 22
  • 22
-4

It is very well possible. If you'd read the manual, you'd have found how:

option httpchk GET /manager/html/list HTTP/1.1\r\nHost:\ myserver.my.domain:8080\r\nAuthorization:\ Basic\ MyT41l0r1sR1ch
Gerard H. Pille
  • 2,569
  • 1
  • 13
  • 11
  • 2
    Goodness. Your first answer and this is how you choose to do it? – GregL Feb 10 '16 at 12:51
  • I know, you're right, I was cross with the first replier. PS. this is only my first answer on ServerFault, but I've been hurting people's feelings on the web for decades. – Gerard H. Pille Feb 11 '16 at 08:55