Running Traefik and Nginx Proxy Manager on 2 separate domains

Hey guys! I am trying to get Nginx and Traefik to work alongside each other however in this scenario I own 2 different domains. The first domain is currently setup with nginx and the second domain is where I am hitting a road block. After the initial installation of the traefik docker container I am able to reach the dashboard however once I go to proxy an App I get a 502 error. Both domains are hosted on Cloudflare and the SSL/TLS was switched from flexible to strict with no change. I also noticed when trying to access an app through traefik it will sometimes bring me to a page saying my nginx is working successfully which I believe is still causing a conflict with ports 80 and 443. I have no problem sharing any of my yaml config files if need be. Appreciate any help on getting this resolved. Thanks!

Please do not share your Traefik static and dynamic configuration, and docker-compose.yml if used. It’s only asked for in every other post, so it’s probably not needed to understand your setup.

Also please do not share any technical details of your setup, if both domains point to the same IP, how your are running two apps in parallel on the server (or VM?), both trying to use ports 80+443.


From your post I understand that you want to run nginx and Traefik. They are usually chained, one has to go in front of the other, as both need the http/s ports.

The port conflict is an issue however I hear some people are able to get both working by using Caddy if I am not mistaking. Can you also explain what you mean by one in front of the other? Are there any workarounds to get both working on individual domains?

< irony on again >
That's a good idea. Use caddy in front of nginx and Traefik, the 3 proxies will get along nicely.
< /irony off >

On a more serious note, only one app can listen on ports 80+443, because only one application can listen to a port at the same time. Therefore you need a "reverse proxy" to receive the requests and forward them accordingly to the right service. This could be caddy, but also Traefik and nginx have that proxy functionality, so I would rather stay with the two you want to use anyway, not add another one.

What do you want to achieve?

Traefik can only proxy, can create TLS/SSL and can auto discover services. Nginx can proxy, but it also serves as a web-server. Which functionality do you need?

A potential setup could look like this

Traefik           match         target

ports       ->   domA.com  ->   nginx  ->   service A
80+443
            ->   domB.com  ->   service B

Appreciate the reply. I am fine with only using Traefik and Nginx only without Caddy if I can get them to work side by side on indiviudual domains potentially however is there any written documentation or a Youtube video I can watch to make this work. Right now I have CF tunnels and nginx working no problem but I would like to implement traefik to test out how it works.

Instill don’t understanding why you want to use nginx and Traefik. Maybe you describe what you want to achieve, what’s the purpose.