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

    Haproxy backend configuration

    Scheduled Pinned Locked Moved Cache/Proxy
    5 Posts 2 Posters 1.0k Views 2 Watching
    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.
    • X Offline
      xttenza
      last edited by

      Hello,
      I would like to ask you about proxying request to backend. Situation:
      I have one server with app which is listening on specific url: https://onesite.com
      I have pfsense in front of it and I want to have onesite server accessible on pfsense1.com url
      what I have is redirect to host, but what doesn't work is sending request with url header of my backend onesite.com
      Now:
      https://pfsense1.com/blablabla -> https://192.168.0.1/blablabla
      what expected:
      https://pfsense1.com/blablabla -> https://onesite.com/blablabla

      Thank you!

      V 1 Reply Last reply Reply Quote 0
      • V Offline
        viragomann @xttenza
        last edited by

        @xttenza said in Haproxy backend configuration:

        what expected:
        https://pfsense1.com/blablabla -> https://onesite.com/blablabla

        This is just an URL, which you can see in the address line of the browser. But this is not seen by the web server. The server can see the SNI and the host header at its best.

        SNI should not be required behind a proxy, however. And the host header can be replaced by HAproxy.

        X 1 Reply Last reply Reply Quote 0
        • X Offline
          xttenza @viragomann
          last edited by

          @viragomann I know, I know, I’m not able to make it happen, I tried that by setting http header, but without success. I read about reqrep which should do this, but it is not supported anymore.

          V 1 Reply Last reply Reply Quote 0
          • V Offline
            viragomann @xttenza
            last edited by

            @xttenza
            What's about 'http-request replace-header', in case it's the wrong?

            1 Reply Last reply Reply Quote 0
            • X Offline
              xttenza
              last edited by

              Okay, there was two issues, one was tcp mode and the second one was under SSL offloading checked: Add ACL for certificate CommonName. (host header matches the "CN" of the certificate)

              so for somebody how will want to have the same:
              Create frontend with SSL Offloading checked
              type http/https offloading selected
              default backend selected
              Use "forwardfor" option checked
              and all other settings unchecked

              backend part
              server with encrypt ssl checked
              health check method none
              and in advanced settings
              backend pass thru
              http-request set-header Host onesite.com
              option httpchk GET /
              http-check send hdr Host onesite.com

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