Hi Experts,
we have tons of proxies defined in apigee, but the client request will be prefixed. For example
/proj/customer (client request.uri) -----rewrite at apigee to> /customer (apigee proxy base path)
I want to chip /proj from the URI the moment it reaches to apigee,i thought of doing it by creating a dummy proxy with a javascript like the one below and forwarding that to the same host pointing the target server to localhost by defining a localhost target server within the apigee. Essentially it's a proxy chaining, is it recommended or any other way to rewrite url at apigee? Pls, provide your approach for this and also how to forward requests to the same host without having a target server defined in hybrid.
var modifiedUri = originalUri.replace("/proj", "");
context.setVariable("request.uri", modifiedUri);
Define a target server with the name localhost and refer apigee dns/FQDN there.
Thanks.
Solved! Go to Solution.
You can use Apigee to do as you describe. It may or ma not be economical to do so, because if you chain proxies, you will run 2 API calls for every request, doubling your Apigee volume.
Many (most?) customers use a load balancer in front of Apigee anyway, and load balancer tools often include URL rewrite capabilities. The Google cloud Load BAlancer (classic) includes this rewrite capability. If that or a similar managed service is not available to you, then you can do rewrites pretty easily with nginx. Here's a tutorial on that. Or you could use envoyproxy to do the same. But this means you would have to manage a group of nginx or envoy servers.
So it's up to you.
Any of these will work fine.
You can use Apigee to do as you describe. It may or ma not be economical to do so, because if you chain proxies, you will run 2 API calls for every request, doubling your Apigee volume.
Many (most?) customers use a load balancer in front of Apigee anyway, and load balancer tools often include URL rewrite capabilities. The Google cloud Load BAlancer (classic) includes this rewrite capability. If that or a similar managed service is not available to you, then you can do rewrites pretty easily with nginx. Here's a tutorial on that. Or you could use envoyproxy to do the same. But this means you would have to manage a group of nginx or envoy servers.
So it's up to you.
Any of these will work fine.
Thanks
Sorry to necro this, but I'm trying to figure this out. Grok is really standing its ground stating that all 3 flavors of GCLB (GCLB Classic, GCLB, and GCELB) all support URL rewrite, but in the docs, I'm only finding it under GCLB Classic. Do you happen to know if this is true? I want to believe it because I can't figure out why Google would remove URL rewrite from GCLB but keep it in GCELB.
Hi @jestafford ,
Isn't this what you're looking for?
Set up global loadbalancer / Add capabilities / Rewrite the requested URL
Br,
Marcello
Yes and no. Yes that answers the documentation problem - thanks for showing where it got buried!
I was just informed that we have an additional layer of complexity. The GCLB configuration here is actually managed via ACM config so we need to figure out how to do this configuration that way rather the "standalone" way. So confusing.