Issue with Proxy chaining

I'm trying to manipulate the Host HTTP header in one proxy (Proxy A) and then call a JavaScript code that uses it in another proxy  (Proxy B) (I need to replace the Host header while sending request to backend service in Apigee, and there is currently a limitation- thus this is the workaround- opened an issue in the Forum).

When implementing this it seems it’s not working, and I’m not sure the Proxy Chaining works for me. I tried using both Connecting proxies by proxy name and Connecting proxies by path but it seems it’s not getting to the second proxy. Here Proxy A= helloworld and Proxy B=annaproxy.

When I’m invoking:

https://radware-apigee-gw-payg-eval.radwarecloud.net/helloworld/               - I’m getting an empty 200 OK, instead of getting to the Target (should get echo response).

helloworld_proxy_chaining_am_policy.jpg

helloworld_proxy_chaining_target_ep.jpg

annaproxy_proxy_chaining.jpg

helloworld_proxy_chaining.jpg

In the Debugger I see EchoRequestExecution and no Variable (I’m setting the target.header.host variable in the AssignMessage Policy), and don’t see the annaproxy invocation.

Added screen shots, would like to understand what’s wrong in my configuration?

0 2 805
2 REPLIES 2

I can't tell exactly what's happening from the description and screenshots.

It appears that, in the helloworld proxy, you have the AddHostHeader policy attached to the Target preflow.

I cannot tell from the Trace if you can observe evidence that it's working. 

But let's step back a bit.  I don't quite understand the problem you're trying to solve.  Maybe you could explain that better. 

Also, if your first proxy (let's call it proxyA) uses a LocalTargetConnection (aka, uses "proxy chaining"), then it will  not use the "target.header.host" to find the target.  Actually, it will use the settings in the LocalTargetConnection element.  Once that local target is found and invoked, that second proxy (call it ProxyB) will find its respective target, according to the configuration you have provided in THAT proxy.  The setting of "target.header.host" in the proxyA will have. no effect on the behavior of proxyB. 

Can you restate clearly what problem you are trying to solve? 

Also, if you really need to use proxy chaining, I suggest you just simplify things , and get a basic proxy chaining scenario working, before fiddling around with hostnames and Javascript and so on.  Just demonstrate to yourself that you can invoke proxyA, and then proxyA can use a LocalTargetConnection to invoke proxyB.  After you get that working, then you can add in things like JAvaScript or whatever else you need to accomplish your goal. 

But ... take care to understand if proxy chaining is really necessary to accomplish the goal. 

"To debug this, let's break it down step by step. First, make sure that Proxy A (helloworld) is indeed modifying the Host HTTP header correctly. Check the logs to ensure it's doing what you expect.Next, for Proxy B (annaproxy), ensure that it's receiving the modified request from Proxy A. Double-check the configuration in Proxy B, specifically the part where it processes requests from Proxy A.If you're still having trouble, consider using Fast proxy setups. Sometimes, a small tweak in configuration can make a big difference. Don't hesitate to share more details or screenshots if needed. "