opnsense, haproxy and issues trying to get haproxy to listen on 443
Hi folks, back with another pfsense > opnsense migration query please, this time regarding haproxy, the opnsense web gui, HTTPS and a virtual IP.
Config looks like this: opensense LAN IP: 10.0.0.1 opnsense virtual IP (alias), for haproxy: 10.0.0.20
NAT rule (IPv4 only) Source: defined alias of a specific external IP protocol: tcp/udp Destination: WAN address dest port: HTTPS redirect to: haproxy alias redirect port: HTTPS filter rule: add/linked/managed by NAT rule
Opnsense setting: System > Settings > Administration: TCP port: 443 Listen Interfaces: LAN, or All (tried both, same result)
Looking at ifconfig I can see the haproxy virtual IP associated with igb2 (LAN), however it seems that the web GUI forcibly takes over the port on all IP's on the interface and results in haproxy being unable to use it, and if i launch a request from the NAT'ed external IP I get the dns rebind attack detected page. Disabling the rebind protection of course just results in the firewall login page loading - not what I want.
Firewall log shows the traffic being passed to the virtual IP, so this doesn't seem like a firewall rule problem, and I can't choose an IP address for the web GUI to listen on - I am curious to see how others solve this.
Ideal outcome for me would be to have the web gui listen on 10.0.0.1:443 and not on 10.0.0.20:443, leaving it available for haproxy. Is the only solution here to have the web gui listen on a different port?
thanks in advance...
Posted Mar 22, 2021, 10:29 AM UTC
I have my webui on 8043 and use haproxy to publish 127.0.0.1:8043 to my firewalls internal dns name.
[removed]
Excellent bot. Learned a lot today and I'm not even done my coffee.