Traefik plus Cloudflare Access stays clean when Traefik owns Host routers and TLS on the websecure entrypoint, while Access sits in front of admin hostnames such as Portainer before the app login ever renders. Keep Portainer on the same user-defined Docker network as Traefik, publish only 80/443 from the proxy, and route by Compose DNS name plus internal port — never a host-mapped localhost that breaks the moment the stack moves. Prefer hostname-shaped Access applications over a single catch-all policy so a dashboard can require a tighter IdP group than a read-only app without rewriting Traefik labels.
After label or Access changes I confirm which Traefik router and middleware chain the Portainer Host hit, that an unauthenticated browser gets the Access challenge rather than Portainer’s own form, and that ACME or cert resolvers still match every public name. A 502 with a healthy Access session is usually wrong network membership, a renamed Compose service, or Traefik still pointing at a published host port. Probe Portainer from inside the Traefik network first, then the same hostname through the public edge, and retire old Host() values from DNS and Access apps when containers leave the lab.