Replace a matching string in http response body

Hello Traefik community.

I have installed a Traefik v2.x reverse-proxy using the official docker image. It receives the request from external apps and pass them to a SOAP API back-end. The SOAP service answers with a WSDL file. In this WSDL (XML) file (in the HTTP response body), I have a string (an URL) that is incorrect and I want to rewrite it before Traefik sending the response back to the calling app.

I know that it exists a module to do that using nginx (http_sub_module) but is it possible to do it with Traefik? I'm quite new using this reverse-proxy, and I think it should be in the "middlewares", but I haven't found one fitting my needs.

Thank you for your time and your answers.

Hello Traefik community,

Since recent versions of Traefik Proxy, it is no longer needed to register to Traefik Pilot to get access to the plugin repository.

Thus, I use the rewriteBody plugin and it works very smoothly.

Have a nice day.

1 Like

This is really interesting when trying to use a path to route to a service that normally runs on /. (Usually you would just use a sub-domain) -> plex.service/

With the plugin absolute redirects and absolute paths from the app could potentially be fixed.