Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How do I route all content with a specific prefix to another service

Not applicable

I want to configure my proxy in the following fashion.

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?

1 3 318
3 REPLIES 3