PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, May 19, 2022

[FIXED] How to Configure Pfsense HAProxy HTTP HealthCheck Failover

 May 19, 2022     haproxy, pfsense, web-application-firewall, web-services     No comments   

Issue

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 - Backup

Configuration 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\nAccept:\ 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 can i achieve this in HAProxy Backend Health Check?


Solution

This can be done under Advanced Settings--> Backend Pass thru using the expect string,

http-check expect string XS01



Answered By - karhtik
Answer Checked By - Timothy Miller (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing