I have installed a Traefik v2.x reverse-proxy. It receives the request from external apps and pass them to a SOAP API back-end.
The SOAP service respond 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 haven’t found a middleware fitting my needs.
Thank you for your time and your answers.
2
Answers
In the latest versions of Traefik (2.9.x for example), there is now no need to registrer to Traefik Pilot program to get access to the plugin repository.
Thus, you can add plugin freely following the Traefik plugin installation guide.
The plugin fitting my needs is the rewriteBody plugin.
To use it, you have to update your static configuration adding this:
And you can use it in your dynamic configuration like
And this works perfectly!
I ended up using nginx (http_sub_module, subsitutions) behind Traefik, that way you can use both nginx and Traefik features!