Navigation

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

    HAPROXY with IIS 7.5

    Cache/Proxy
    2
    5
    2119
    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.
    • Y
      yunushaikh last edited by

      Hi,

      I am using haproxy for load balancing IIS servers.

      backend Nameofbackend
          mode http
          balance roundrobin
          option forwardfor
          option httpchk HEAD / HTTP/1.0\r\nHost:localhost
          cookie SERVERID insert indirect nocache
          server HOSTNAME IPADDRESS:PORT check
          http-request set-header X-Forwarded-Port %[dst_port]
          http-request add-header X-Forwarded-Proto https if { ssl_fc }

      When I disable the tag option httpchk HEAD / HTTP/1.0\r\nHost:localhost, the url works fine

      But when we enable this it stops working.
      I need this tag for server health check. Can someone please help me with the correct configuration. Or I need to check something on IIS side?

      Any help will be appreciated. Thanks

      1 Reply Last reply Reply Quote 0
      • P
        PiBa last edited by

        Try changing:
        localhost to www.your.tld (the domain name you want the enduser visit)
        1.0 to 1.1
        HEAD to GET or OPTIONS

        1 Reply Last reply Reply Quote 0
        • Y
          yunushaikh last edited by

          Hey PiBa,

          It worked perfectly
          Thanks a ton for your help man. You are awesome.

          But can you please tell me the options we changed what difference does it makes from current configuration.

          I am new to HAPROXY so want to understand difference

          HEAD and OPTIONS ?
          instead of localhost why we need domain name?

          1 Reply Last reply Reply Quote 0
          • P
            PiBa last edited by

            GET is the normal http command to request a webpage so pretty much always works. But does request the full body of the website, and could cause some overhead. When asking for OPTIONS the webserver does not need to try to serve up the complete webpage. Same for HEAD this should allow for less wasted processing time on the iis server. But not all web-servers support all HTTP commands.

            The 'localhost' it could be that the webserver is expecting the website/virtualhost requested before generating a valid reply, the expected requested domain name would surely not be localhost, not sure if that is the case for iis..

            1 Reply Last reply Reply Quote 0
            • Y
              yunushaikh last edited by

              Thanks a lot dear for quick help.
              You made my weekend good :)

              1 Reply Last reply Reply Quote 0
              • First post
                Last post