Is it possible to define a middleware in traefik.toml or dynamic configuration file and re-use it in individual routers (with docker-compose labels)?
This is what I'm currently using:
- "traefik.http.middlewares.cf-whitelist.ipwhitelist.sourcerange=220.127.116.11/20, 18.104.22.168/22, ..."
What I would like to have
traefik.toml [http.middlewares] [http.middlewares.cf-whitelist.ipWhiteList] sourceRange = [ "22.214.171.124/20", "126.96.36.199/22", ... ]
and reference only the middleware in docker-compose files:
This IP list might be due to change, so it would be best to have it managed in a single file.
Middlewares can be defined for an entry point, right? However, that wouldn't probably work as I can only have one entry point for port 443, and I don't want this whitelist to be enabled for every single router on that entry point.
Is defining a global middleware this way possible? Am I doing something wrong here? I have tried adding this middleware to both the static configuration file, and dynamic configuration file and it didn't work for either. It only works if it's defined in docker-compose.