If the container is offline, the whole dynamic config is removed, so the middleware doesn’t work anymore.
You would probably need to define another catchall service with low priority (like 1) with a regex rule to match any request (or just the specific host), when higher priority router is not available.