Creating a dynamic proxy route using http request with {variables}. Adding route variables to the request proxy

Is it possible to give dynamic routes to the an URL. I'm looking to do something like this.. I want to set my proxy like this.

www.test.com routes to www.test2.com

www.test.com/{version} routes to www.test2.com/{version}

Is it possible to set a route up like this?

Is it possible to add route parameters to the query? Such as.. www.test.com/{version} I didn't see anything in the documents about this.. Is it assumed to be that way?

Also how would I do something like this.. www.test.com/{version}/file and www.test.com/{version}. Would this have to be 2 seperate API proxies? Or can I do this under one api proxy.

0 4 422
4 REPLIES 4

a proxy (Actually a proxy endpoint) is defined by a virtual host and a basepath. A vhost implies a hostname and scheme (http / https).

So....

https://www.test.com would be the vhost

and then basepath can be anything , including / , the empty path.

So if you stand up a proxy like that, every request to https://www.test.com will be sent to that proxy.

www.test.com/

www.test.com/foo

www.test.com/bar

and so on

Apigee, barring any other configuration, acts as a passthrough proxy. Which means if your target is www.test2.com then inbound requests get proxied there, and all the inbound path gets propagated to the outbound path.

Okay, What about creating dynamic URI parameters in apigee? i'm keen to know that response

yes, assign message policy does that.

I encourage you to check out the introductory videos and read the docs, go through the tutorials.

Not applicable

if you want to create dynamic target url, the variable is target.url and this should be set in the target endpoint preflow. you can use assign message or javascript policy to set your dynamic target. I normally prefer javascript policy to have more flexibility of dynamic target creation. But yes As Dino said only to add the path suffix to your target url you neednot to do anything, it automatically gets appended to your target.