Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    How to Configure Pfsense HAProxy HTTP HealthCheck Failover

    Scheduled Pinned Locked Moved Cache/Proxy
    2 Posts 1 Posters 1.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      anandpeculiar
      last edited by

      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 - 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\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?

      A 1 Reply Last reply Reply Quote 0
      • A
        anandpeculiar @anandpeculiar
        last edited by

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

        http-check expect string XS01

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.