Dual traefik instance?

Hi

Currently I have a working docker traefik container that allows acessing a whoami webserver container at https://whoami.mydomain.com. For that I port forwarded in pfsense the 443 port to the IP where docker is running. All worked OK even the Let's Encrypt certificate negotiation!

Now imagine that I want to have another docker (in a different IP) serving another whoami container but this time at https://whoami.myotherdomain.com.

I tried to use in this second docker a second instance of traefik. I repeated the port forwarding of 443 port to this second IP at pfsense (I do not know if that is problematic even not getting any error inside pfsense) but now the certificate generation seems to not work!

Maybe all of you are thinking: Do not do that! Use only one traefik to both whoami servers!

But imagine that I have interest in having separated instances of traefik. Is this possible?

Best regards,
Hélio Mendonça

You can run multiple instances like you describe. 1 per docker host. However, you cannot forward the same port (on the pfSense router) to multiple hosts.

If you want multiple hosts to "share" the external port you would need an additional instance of traefik just for routing between your other traefik instances and the gateway router.

1 Like

Just thinking outside the box here -- never tried this -- but what if you hooked pfsense LAN port to switch and then configured the switch port to replicate to a second port and then hooked up two docker hosts to each port. I'd admit this solution wouldn't scale well

1 Like

Thanks for the tips.
For now I concentrated the routing in a single traefik!
Best Regards