I want to configure my proxy in the following fashion.
- All requests by default get passed through to http://main.api.com
- Any request that has has a URI path that start /admin gets routed to http://admin.api.com
I have tried using RouteRule:
<RouteRule name="mocker">
<Condition>(proxy.pathsuffix JavaRegex "^/admin/?.*$")</Condition>
<TargetEndpoint>MockTarget</TargetEndpoint>
</RouteRule>
<RouteRule name="default">
<TargetEndpoint>default</TargetEndpoint>
</RouteRule>
This partially works in that is does indeed route to a different host. However, it maintains the path; so requesting /admin/foo/bar gets redirected to http://admin.api.com/admin/foo/bar, but I wanted it to go to http://admin.api.com/foo/bar
How can I achieve that?