Auto-detected service port routes to wrong container port with multiple exposed ports
criticalWhen a container exposes multiple ports (e.g., application port 8080 and metrics port 9090) and traefik.http.services.<name>.loadbalancer.server.port is not explicitly set, Traefik's auto-detection may select the wrong port. Requests route to metrics endpoint or health check port instead of application, causing 404s or unexpected responses. Problem often appears after adding monitoring/admin ports to existing services.
Query Traefik services API with 'docker exec -it traefik sh -lc "wget -qO- http://127.0.0.1:8080/api/http/services"' to see which port Traefik selected. Check container exposed ports with 'docker ps' or 'docker inspect'. Always set traefik.http.services.<service-name>.loadbalancer.server.port explicitly to the application port. Test upstream connectivity from Traefik container to verify correct port.