OPNsense Forum

English Forums => Web Proxy Filtering and Caching => Topic started by: rogafe on June 25, 2024, 03:03:05 PM

Title: HAProxy: Efficient Domain-Based Traffic Routing on Proxmox
Post by: rogafe on June 25, 2024, 03:03:05 PM
Hello everyone,

Sorry if the question was already posted, but the search is a little bit difficult here.

I'm currently running a Proxmox server hosted on a dedicated Hetzner server, and I am exploring the possibilities of configuring HAProxy for more advanced traffic routing between my VMs.

Here's the context of my existing setup:


Before I lease another IP from Hetzner, I want to see if HAProxy can handle my specific requirements for directing traffic based on domain names. Specifically, I'm looking to set up routing rules like:


Diagram of the Setup:
(https://i.rogafe.pw/ROdo9/guqEfIZU47.png/raw)

My questions are:


I'm looking for any advice or experiences that could help me determine the feasibility of this setup without needing an additional IP.

Thanks in advance for your input!
Rogafe
Title: Re: HAProxy: Efficient Domain-Based Traffic Routing on Proxmox
Post by: cookiemonster on June 25, 2024, 03:54:13 PM
you do realise that kasm.rogafe.domain fits inside *.rogafe.domain right ?
That means that any reverse proxy will not be able to set those apart.
One of the most popular guides will give you a good idea how to setup HAProxy https://forum.opnsense.org/index.php?topic=23339.0
But yes, this is what reverse proxies do and the HA plugin in OPN is very comprehensive.
Title: Re: HAProxy: Efficient Domain-Based Traffic Routing on Proxmox
Post by: rogafe on June 25, 2024, 09:50:46 PM
Quote from: cookiemonster on June 25, 2024, 03:54:13 PM
you do realise that kasm.rogafe.domain fits inside *.rogafe.domain right ?
That means that any reverse proxy will not be able to set those apart.
One of the most popular guides will give you a good idea how to setup HAProxy https://forum.opnsense.org/index.php?topic=23339.0
But yes, this is what reverse proxies do and the HA plugin in OPN is very comprehensive.

I do realize that the domain kasm.rogafe.domain fits within the wildcard *.rogafe.domain. However, based on my experience with DNS, when a specific domain record like kasm.rogafe.example is defined, it usually takes priority over the wildcard.

But I do not have enough experience in HAProxy, so I am not sure if it works the same way. Thank you for your response and the link. I'll definitely check it out for more detailed information on setting up reverse proxies.