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 http://10.99.0.10:8080
Problem:
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 https://example.com:8080/wp-admin 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 http://10.99.0.10:8080 it redirects it to https://10.99.0.10, 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 http://10.99.0.10:800 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.