basforge

Search titles, text and the “If it doesn’t work” cases.

    RU

    Middleware on a router that doesn’t exist raises no error

    Check the router name in every label. Traefik silently accepts a label with a typo in the name: it creates one more router, and the real one stays unprotected.

    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-secure in the label, while the routers are app-https and app-http. Traefik created an extra app-secure router.
    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).