What happens
A routers.app-secure.middlewares=… label next to real routers app-https and app-http raises no error.
Traefik silently creates another router, app-secure, with the default rule, and the real one never gets the
protection. The site works, there’s no protection, and nothing shows from outside.
- "traefik.http.routers.app-https.rule=Host(`app.example.org`)"
- "traefik.http.routers.app-secure.middlewares=crowdsec@file" # typo: no such router
If it doesn’t work
Attached protection to a router — the site works, but there’s no protection
- Cause
- The middleware hangs on a router with a different name:
app-securein the label, while the routers areapp-httpsandapp-http. Traefik created an extraapp-securerouter. - Fix
- Fix the name in the label and check the router list in the Traefik dashboard or API.
How to check
The Traefik dashboard or API shows routers and their middlewares, and the extra router stands out. Or test it for real: ban your own address and see that the site doesn’t open (CrowdSec with Traefik behind Cloudflare, Test your server’s protection by action).