How to create a "backup" router to be used when primary router's services are down?

s there a way to disable the router completely when all its services has no available servers ?

i would need this feature because i am using 2 routers for the same pathMatch, but pointing to different backend service

the reason why i am using 2 different routers is because i need to pass different headers (use different middlewares) on the different services, and this would not be possible using a single router

i cant use allowEmptyServices because this would only change the returned code, but the router would still be created. so the issue i am facing is the following:

  • router1 - rule "Match(example.com)"
    • middlewareA
      • serviceA
  • router2 - rule "Match(example.com)"
    • middlewareB
      • serviceB

and i would like all requests to be forwarded to route2 when serviceA is not reachable (has no servers)

link to gituhub issue: Avoid routing to dead Kubernetes services when there are other available with live endpoints · Issue #9174 · traefik/traefik · GitHub