I have a use-case where I need to rewrite an Upstream URL to route to a specific backend service in a cluster. We will receive a dynamic variable in the POST request to our TYK gateway something like
The dynamic upstream URL I need to then create will follow something like http://{var}.svc.cluster/ extracting the {var} value from the request URL into the TYK gate
I’ve had a look at the URLRewrite plugin however this sets the upstream url to a constant value and then appends the rewrite logic at the end of that url instead of changing the upstream url completely. Any ideas to achieve this?
It appears you are already on the right track with the rewrite and regex logic. For the dynamism have you checked that our doc doesn’t have what you are looking for?