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

    HAProxy doesn't resolve on LAN interface

    Scheduled Pinned Locked Moved Cache/Proxy
    4 Posts 3 Posters 798 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.
    • J
      juananpc
      last edited by juananpc

      Hello,

      I followed this guide to configure HAProxy as a reverse proxy https://www.youtube.com/watch?v=bU85dgHSb2E

      After following the guide and ensuring that I perform all the steps correctly, I couldn't access the servers locally by selecting the LAN interface in the Frontend. Instead, by selecting the WAN interface, I was able to access externally without any issues.

      I tried testing by selecting both WAN and LAN interfaces in the Frontend, and the same thing happened – it worked externally but not locally. Every time I tried locally, I got an ERR_CONNECTION_REFUSED.

      So, I decided to try selecting ANY as the Frontend interface... and surprise... it works both externally and locally!

      What could be the problem? Why does selecting WAN always work, LAN never works, and ANY work for both? Something is escaping me...

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

        @juananpc
        If you want to access the server with the LAN IP you even need to configure your internal DNS to resolve your host name to the LAN IP.

        J 1 Reply Last reply Reply Quote 0
        • J
          juananpc @viragomann
          last edited by

          @viragomann Hello, thank you for responding.

          I might not have explained myself clearly. In the DNS Resolver configuration, I have the servers included in the Host Overrides list pointing to the pfSense LAN IP.

          In fact, the host resolves correctly locally when I select "any (IPv4)" in the HAProxy frontend. I've also verified this with nslookup.

          The issue come when, instead of selecting "any" (IPv4) in the frontend, I choose the "LAN address (IPv4)" option. Then I encounter an ERR_CONNECTION_REFUSED.

          johnpozJ 1 Reply Last reply Reply Quote 0
          • johnpozJ
            johnpoz LAYER 8 Global Moderator @juananpc
            last edited by

            @juananpc said in HAProxy doesn't resolve on LAN interface:

            instead of selecting "any" (IPv4) in the frontend,

            What exactly are you trying to proxy? Why would you pick the lan address?? I have to things I run through ha proxy. One frontent directly listens on my wan IP. Other listens on my loopback since I share this port with openvpn 443, and when its not openvpn traffic, openvpn using share port option sends this to the loopback on a port 9443 and haproxy sends that on to the backend.

            If I want to access either of these from my lan, I access my wan IP on the ports being used 443 or 44301 and the proxy sends me to the backend.

            An intelligent man is sometimes forced to be drunk to spend time with his fools
            If you get confused: Listen to the Music Play
            Please don't Chat/PM me for help, unless mod related
            SG-4860 24.11 | Lab VMs 2.8, 24.11

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