Is possible to run Traefik on docker and Nginx on the host on the same server?

In a server, I set up Traefik with docker(I'm using Put Wildcard Certificates and SSL on EVERYTHING | Techno Tim Documentation tutorial. I got the certificate, but on the host system, I did host a LEMP stake for WordPress. And I did set up the WordPress site and it worked and it is before setup the Traefik proxy. The reason I want to do this wants Traefik manages the certificate and does the proxy for other services on that server.

Since Traefik is listening on port 443 and port 80, I had to change Nginx listening port to port 8080.

On Traefik I use the dynamic files provided to proxy the IP address of that server itself. I use


After setup all set up, from the Internet, the website work, but when I put /admin to login, it says redirect too many time. In addition, when put /wp-admin it will add port 8080 at the end of my domain, so it becomes and it says can't access the secure site, error: SSL_ERROR_RX_RECORD_TOO_LONG, So now I'm locked out.

I did try:

Try it from the local network, when I put it redirects it to, which is Traefik's default error page(I guess that's why it doesn't work... why is Traefik will redirect port 8080 to secure?)

So, I change Traefik dynamic listen entry from to http://localhost:8080, and did not work: it says 502 bad gateway(I guess the reason is that it refers to one inside the container, not the outside host localhost address?)

It will work if I shut down the Traefik docker container, and change the Nginx configuration back to port 80 and 443 old configurations I have, it will work fine again and I was able to log on to the WordPress administrator page again.

If anyone knows what is happing, Please let me know how I fix it, any help would be appreciated.

You can check the simple Traefik example and just replace whoami image with your nginx.

Wordpress remembers the domain and port you configured it to originally, when you change this only on the proxy/server, it will always try to redirect. You need to change it in WP settings, too.

the way you do it in the container, the WordPress and database will be in the container, not on the host.

I have done that before, if I separate the proxy and the WordPress website in a different host they will proxy ok(but it was port 80, not 8080). My WordPress website profile was originally and right now set at, so if I change it to if I do that, I think I might have to break many permalinks.