rewrite-body icon indicating copy to clipboard operation
rewrite-body copied to clipboard

Path filter

Open muratcorlu opened this issue 1 year ago • 1 comments

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.

muratcorlu avatar Feb 19 '24 13:02 muratcorlu