rewrite-body
rewrite-body copied to clipboard
Path filter
Describe the solution you'd like It would be great to be able to replacement for a specific path prefix without needing to define a new traefik router.
services:
mysite:
...
labels:
traefik.http.middlewares.my-injector.plugin.rewritebody.rewrites[0].regex: </body>
traefik.http.middlewares.my-injector.plugin.rewritebody.rewrites[0].pathPrefix: /admin
traefik.http.middlewares.my-injector.plugin.rewritebody.rewrites[0].replacement: <script src="admin-analytics.js"></script></body>
traefik.http.routers.mysite.rule: Host(`mysite.com`)
traefik.http.routers.mysite.service: mysite
Describe alternatives you've considered I think this is currently possible by creating a separate route definition that points same service. But that add too much repeating and crowd.