-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Does the plugin support declaring multiple replacement operations?
If want to:
- Replace
^/fooby /xxx/foo` - Replace
^/barby /xxx/bar`
(Note: I want all theses operations to occur on the body, not the first matching one)
I currently have to create/declare 2 middlewares:
[http.routers]
[http.routers.my-router]
rule = "Host(`localhost`)"
middlewares = ["xxx-prefixer1", "xxx-prefixer2"]
service = "my-service"
[http.middlewares]
[http.middlewares.xxx-prefixer1.plugin.rewritebody]
[[http.middlewares.xxx-prefixer1.plugin.rewritebody.rewrites]]
regex = "foo"
replacement = "/xxx/foo"
[http.middlewares.xxx-prefixer2.plugin.rewritebody]
[[http.middlewares.xxx-prefixer2.plugin.rewritebody.rewrites]]
regex = "bar"
replacement = "/xxx/bar"
[http.services]
[http.services.my-service]
[http.services.my-service.loadBalancer]
[[http.services.my-service.loadBalancer.servers]]
url = "http://127.0.0.1"
If I could have something like the following ([http.services] part omitted for brevity):
[http.routers]
[http.routers.my-router]
rule = "Host(`localhost`)"
middlewares = ["xxx-prefixer"]
service = "my-service"
[http.middlewares]
[http.middlewares.xxx-prefixer.plugin.rewritebody]
[[http.middlewares.xxx-prefixer.plugin.rewritebody.rewrites.0]]
regex = "foo"
replacement = "/xxx/foo"
[[http.middlewares.xxx-prefixer.plugin.rewritebody.rewrites.1]]
regex = "bar"
replacement = "/xxx/bar"
It would be easier to maintain.
Thanks
Metadata
Metadata
Assignees
Labels
No labels