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

    HAProxy reverse proxy for lan servers with port

    Scheduled Pinned Locked Moved Cache/Proxy
    6 Posts 2 Posters 712 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.
    • I
      iSagen
      last edited by

      I have, after some help, managed to get reverse proxy from the internet to work.

      My next project is to use HAProxy again, but this time to make ie files.local to point to ip:port on my lan, so I don't have to remember all the different ports.

      I point the domain "local" to the pfsense box on the lan in dns.

      I set up a new frontend listening to the pfsense local ip and port 80

      I made a new backend, pointing files.local to the local ip and port 80. And that works.

      But any other port than 80 does not work after configuring the backend with the correct port. The browser just time out. What did I miss?

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

        @iSagen
        So you have a backend server, which is accessible with say <IP>:81.You have tested the connection from inside.
        You have configured a HAproxy backend accordingly and an ACL plus an action to go to this backend in the frontend?

        Can you provide more details on this, please?

        I 1 Reply Last reply Reply Quote 1
        • I
          iSagen @viragomann
          last edited by

          @viragomann

          DNS Override
          4d43c3a7-820d-42e3-bb17-38f73f0bbeaa-image.png

          Frontend:
          99e2c15e-5afc-461d-84da-2476d5e52eba-image.png

          Backend that works:
          3b21b5fe-0e45-4543-bd07-42ad9fd70711-image.png

          Backend that don't work:
          22523f38-7565-432a-91b9-fee7129dcfd3-image.png

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

            @iSagen
            Note, that a DNS domain override is meant to forward DNS requests for the stated domain to another name server. Hence it is useless if your DNS is hosted on pfSense.
            In this case you just need to add host overrides for each. Or if you want to point the whole local domain (*.local) to a single IP (I don't think, this is, what you want, but maybe) you can do this with a 'local-zone' entry in the Resolvers custom options:

            server:
            local-zone: "local" redirect
            local-data: "local IN A 192.168.10.1"
            

            So ensure that the host names are resolved well.

            Then how do you access the files.local? Via http?
            You have configures a http frontend. This can only treat http requests.

            And what means "it doesn't work"? What is the error?

            I 1 Reply Last reply Reply Quote 0
            • I
              iSagen @viragomann
              last edited by iSagen

              @viragomann

              If I write "piaware.local" in my browser, I am redirected to 192.168.10.36 and there the server is on port 80. So I am served.

              If I write "files.local", where the server is at port 30044, nothing happens, it just times out. This server is at 192.168.10.40

              1 Reply Last reply Reply Quote 0
              • I
                iSagen
                last edited by

                Any tips on how to get this working?

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