I’m trying to configure Traefik v3 to allow access to a specific route (e.g., /admin) only during office hours — say, from 9:00 AM to 6:00 PM server time.
I’ve been digging through middleware options but can’t find a native way to do this with time-based rules. Is there any workaround to enforce time-based access control in Traefik, or do I need to handle that logic in the backend?
Would love to hear how others have approached this — or if maybe a plugin can help here.
There is no time-based handling in Traefik. Check the middleware plugins or create you own.
Alternatively create a cron job and write a dynamic config file, you could create an additional router with same rule and higher priority during non office hours and proxy to a "Closed" page.
Thanks so much, @bluepuma77 — your suggestion to use a cron job with dynamic config and an alternate high-priority router for off-hours is a clever workaround. Really appreciate the insight!