-
Enhancement
-
Resolution: Done
-
Major
-
2.2 CR1, SaaS
-
None
Currently, when upstream and URL rewriting policies are used together, the upstream policy will always take into account the rewritten path instead of the original one, regardless of the position of the policies in the chain (i.e. even when the upstream policy is placed before URL rewriting).
This is counter-intuitive (although explained in the docs), and doesn't support the following use case:
I want to rewrite both the URL and the upstream based on the path prefix, e.g.
http://gateway/v1/books/123 => http://apiv1.myapi.com/books/123 http://gateway/v2/authors/44 => http://apiv2.myapi.com/authors/44
This is not possible, because regardless of the order of the policies, the URL rewrite, which acts in the rewrite phase changed the path and removes the /v1 and /v2 prefix, so the upstream policy, that acts in the content phase doesn't see it and can't change the upstream as expected.