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

    Add subdomain to haproxy

    Scheduled Pinned Locked Moved pfSense Packages
    5 Posts 2 Posters 2.5k 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.
    • G
      gschmidt
      last edited by

      Hi,

      For hosting Domoticz as a web app, I have haproxy/acme running on my pfSense router/firewall for a while now.
      FrontEnd Type: http/https offloading

      It took me quitte some time to make it work because this is not my core business.

      Next phase is that I want to add a subdomain pointing to a different host (node-red) in my network.
      Before I start, I need to know some info:

      1. Do I need a second certificate, or is the certificate I have running on ACME and using for the domain also valid for the subdomain?

      2. Do I only need to create a second backend, or do I need a second frontend as well?

      3. I have cloudflare dns pointing to my namecheap domain. When i create a subdomain, do I need to create a CNAME or an A record?

      Maybe someone can help me out here?

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

        @gschmidt said in Add subdomain to haproxy:

        Do I need a second certificate

        Yes, unless you have a wildcard certificate included.

        Do I only need to create a second backend, or do I need a second frontend as well?

        You need a backend for each internal server you want to forward traffic to. So yes.
        But you have to do it with a single common frontend or even a shared frontend. You have to add an additional ACL for the subdomain and use this to forward it to the additional backend.

        I have cloudflare dns pointing to my namecheap domain. When i create a subdomain, do I need to create a CNAME or an A record?

        I don't know, how to set it up on Cloudflare, but basically both is possible. However, configuring a CNAME and point it to the primary domain name might be smarter. This way you don't need to add an additional dynamic DNS client to pfSense.

        G 2 Replies Last reply Reply Quote 0
        • G
          gschmidt @viragomann
          last edited by gschmidt

          @viragomann

          Thanx got it working!

          I have updated my certificate to a wild card certificate which makes it much easier to set it up.
          The CNAME for the subdomain is working
          Created a backend and updated the frontend by adding a second ACL to the subdomain and an action pointing to the new backend.

          1 Reply Last reply Reply Quote 0
          • G
            gschmidt @viragomann
            last edited by

            @viragomann

            One last question
            How and where (frontend/backend) do I setup a host that has a webserver located in a subdirectory? e.g. 192.168.1.51:1880/ui

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

              @gschmidt
              In the frontend. You have to add an ACL for it with expression e.g. "Path starts with" and enter "ui" for the value.
              And then add an action to direct it the the desired server.

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