On 10 February 2012 14:50, Sebastian Fohler <i...@far-galaxy.de> wrote:
> > What URL does haproxy use exactly to check the service? > Is it the realm + the url part or something else? > Just to be sure to test the correct option. > > Hi Sebastian If you are just using the "check" option for the backends, then the health check is considered successful if a successful TCP connection can be established on the IP/port specified for the backend. This is often not a good indicator of health for HTTP applications, and for those you can use "option httpchk" to do actual HTTP requests. This option may take any of these forms: option httpchk - Does an HTTP/1.0 GET for the URI "/" option httpchk <uri> - As above, but you can specify the URI to use instead of "/" option httpchk <method> <uri> - As above, but you can specify the HTTP method as well (GET, POST, etc.) option httpchk <method> <uri> <version>, As above but you can also specify the version, i.e. if you want to use HTTP/1.1 instead. To use this you probably need to send the HTTP Host: header as well, you can see in my example below how that's done. In all cases, the health check is considered successful if the HTTP status code returned from the backend is 2xx or 3xx. The last form is typically the most useful. Let's say your app is www.example.com and you decide that retrieving the URI /test is the way to determine if it's healthy or not, you would then use the following in the backend definition: option httpchk GET /test HTTP/1.1\r\nHost:\ www.example.com If you still have questions, please post the backend definition from your config file. Graeme. , which the docs (http://haproxy.1wt.eu/download/1.4/doc/configuration.txt) describe as follows: