OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • Web Proxy Filtering and Caching (Moderator: fabian) »
  • HAProxy: Efficient Domain-Based Traffic Routing on Proxmox
« previous next »
  • Print
Pages: [1]

Author Topic: HAProxy: Efficient Domain-Based Traffic Routing on Proxmox  (Read 1316 times)

rogafe

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
HAProxy: Efficient Domain-Based Traffic Routing on Proxmox
« 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:

  • Server: Proxmox is hosted on a dedicated Hetzner server.
  • Current Configuration: OPNsense is already in use as the firewall, and I'm considering integrating HAProxy for specific routing needs.

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:

  • Directing traffic for kasm.rogafe.domain exclusively to a VM designated for KASM.
  • Routing all other subdomains matching *.rogafe.domain to a different VM called Cloud where I run my docker using compose + traefik.

Diagram of the Setup:


My questions are:

  • Can HAProxy, when configured on OPNsense, handle this type of domain-based routing efficiently?
  • Are there any special considerations or settings in HAProxy that I should prepare for to enable such routing?
  • If anyone has implemented a similar configuration, could you share your insights or point out any potential issues I should be aware of?

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
« Last Edit: June 25, 2024, 03:07:20 pm by rogafe »
Logged

cookiemonster

  • Hero Member
  • *****
  • Posts: 1827
  • Karma: 95
    • View Profile
Re: HAProxy: Efficient Domain-Based Traffic Routing on Proxmox
« Reply #1 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.
Logged

rogafe

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Re: HAProxy: Efficient Domain-Based Traffic Routing on Proxmox
« Reply #2 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.

Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • Web Proxy Filtering and Caching (Moderator: fabian) »
  • HAProxy: Efficient Domain-Based Traffic Routing on Proxmox
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2