mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-21 01:11:38 -05:00
[GH-ISSUE #1220] Multiple domains and Traefik #1815
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SigmaSquadron on GitHub (Aug 5, 2025).
Original GitHub issue: https://github.com/fosrl/pangolin/issues/1220
Hi! While developing the NixOS module for Pangolin, we came across an issue with Pangolin's configuration. More specifically, we have no idea how to configure Traefik with more than one domain configured in a self-hosted Pangolin.
While personally I have no use for multiple domains, it is my responsibility as an OS developer to account for all possible configurations for Pangolin. Could the docs be expanded on how to set up additional domains in Traefik for a self-hosted Pangolin?
@oschwartz10612 commented on GitHub (Aug 6, 2025):
Hi! Are you interested in multiple domains for the resources? That is
covered in the docs and can be added in the UI or in the config file.
For the pangolin UI itself I dont think we can do multiple domains right
now because of the config
dashboard_url:.On 8/5/25 16:23, Fernando Rodrigues wrote:
@SigmaSquadron commented on GitHub (Aug 7, 2025):
Hi! Thanks for the reply, but I think I may have expressed myself incorrectly. I wished to know about the appropriate Traefik configuration for handling multiple domains configured in Pangolin. For example, if I add
example.comas my dashboard domain and default base domain, I need to configure the appropriate routers in Traefik so the Next.JS router is exposed to connections at pangolin.example.com. If I add a new domain (example2.com) through the Pangolin config file or through the UI, do I need to configure anything in Traefik?I know I need to ensure that the certificate resolver in the Pangolin config file for each domain matches the certificate resolves in Traefik, but I'm not sure if I have to set up a router for each domain or not.
@SigmaSquadron commented on GitHub (Aug 7, 2025):
Furthermore, with #1221 in mind, which Traefik needs to have the
certificateResolversset up for HTTPS? The Traefik running in Pangolin's machine or the Traefik running in Gerbil's machine?@oschwartz10612 commented on GitHub (Aug 8, 2025):
I don't think you could have multiple domains for the UI right now. But this could be tested. I could be completely wrong.
Because the dashboard base URL is used in a couple of places, I think having a separate domain might cause issues. But, yes, you would generally - assuming this wasn't an issue - duplicate all of the routers in the dynamic config that point to the local Pangolin 3000 ports. For example, you would add a new one with the secondary UI URL and point it to 3002. Would that make sense?
I've never actually tested this but it could be tested. Let me know if you do.
@SigmaSquadron commented on GitHub (Aug 8, 2025):
Sorry, that's not what I meant! I'm referring to a hypothetical setup where Gerbil and Pangolin are running on different machines, and I have two domains I can use to route resources to.
Pangolin has
maindomain.comconfigured in the config file, using the DNS resolver for that domain. After I logged in as an admin, I have also set-upsecondarydomain.com, which uses thetraefikseries of rules for certificate resolution. The dashboard is only available frompangolin.maindomain.com; it cannot be accessed fromsecondarydomain.com, and serves only to route resources likeserviceA.maindomain.comandserviceB.secondarydomain.com. The machine running Pangolin has the proper dynamic Traefik configuration for routing the API and dashboard to thepangolin.maindomain.comURL.secondarydomain.comdoesn't appear in the Traefik config at all, so I'm hoping it's all handled by Pangolin's traefik-config endpoint.Gerbil is running on another machine, and connects to Pangolin using
--remoteConfig. My question is: what parts of Traefik need to run in either machine in order to route resources through two domains in this split Gerbil/Pangolin setup? Do the certificate resolvers also need to be set up in this Traefik's static configuration?Badger is set up on the instance of Traefik running on Gerbil's machine. Does it need to run on the machine running Pangolin as well? I'm also hoping it can retrieve its configuration from the same
traefik-configendpoint.@oschwartz10612 commented on GitHub (Aug 16, 2025):
Ahh okay yes this domain would be handled entirely in the config
generated by Pangolin for Traefik. You would want to have Traefik
deployed with gerbil and pulling config from the remote Pangolin so
that it creates the routes locally to send down the Gerbil tunnel. Does
that make sense?
You would not need Badger on the Pangolin Traeifk. This is just
basically doing normal reverse proxy stuff and could really be any proxy.
@SigmaSquadron commented on GitHub (Aug 16, 2025):
That is absolutely perfect, thank you!