Hi,

Le 03/01/2013 23:16, Zachary Stern a écrit :
So, very odd issue.

I have my HAproxy configured as follows (URLs and IPs have been obfuscated):
https://gist.github.com/4447840

The URL that it is set to check for to make sure the backend nodes are
up doesn't exist yet.

And yet, when I got to haproxyip/haproxy?stats, it shows both servers as up!

What am I missing here?

The issue is in your "option httpchk" syntax.
The parameter is not declared as expected :
 option httpchk http://someurl.stag.somecompany.com/foo.jpg
Several issues here :
1. the HTTP request will provide a "OPTION" method, which, I guess, replies with a "200 OK". 2. When specifying the parameters, you must think HTTP : the hostname should be provided in a "Host" header

Here is what haproxy sends with your configuration.
OPTIONS http://someurl.stag.somecompany.com/foo.jpg HTTP/1.0

Please try with something like :
option httpchk GET /foo.jpg HTTP/1.1\r\nHost:\ someurl.stag.somecompany.com

Which will send this request :
GET /foo.jpg HTTP/1.1
Host: someurl.stag.somecompany.com

It's tricky but it is how haproxy accepts to provide headers in the check request ;-)

You can have a look to the example provided in the documentation for more details :
http://cbonte.github.com/haproxy-dconv/configuration-1.4.html#option%20httpchk


Thanks in advance.

-Zachary



--
Cyril Bonté

Reply via email to