How to Configure Pfsense HAProxy HTTP HealthCheck Failover
-
Re: HTTP Health check backend with HAProxy package via GET request
I have two backend web servers, and i need to monitor them using httpcheck by checking the URL and looking for a string to be present in the response of the request. if the string is not available switch the backend to another server.
Status:
Server1 - Active
Server2 - BackupConfiguration Details:
- Health Check Method : HTTP
- HTTP Check Method : GET
- Url used by http check requests:
/jsonp/FreeForm&maxrecords=10&format=XML&ff=223
- Http check version :
HTTP/1.0\r\nExpect:\ XS01
Result of the http Request is
{"d":{"__type":"Response","Version":"4.5.23.1160","ResultCode":"XS01","ErrorString":"","Results":[{"__type":"Result",
so, I am expecting the string ResultCode:"XS01" in the response from the server, if the string found the server1 is up, if not bring the Server2 from the backup.
How to achieve this in HAProxy Backend Health Check?
-
@anandpeculiar this can be done under Advanced Settings--> Backend Pass thru using the expect string,
http-check expect string XS01