When we are hardcoding our target server url while creating a proxy in 'Backend Service URL' then we are getting 200 OK as a response
But when we are using JS policy to set our target.url(which is same as above) then we are getting 301 in response.
In JS we are setting target server url with
context.setVariable("target.url", targetserverurl);
Does anyone know where the problem can be .... in apigee routing?? or apigee server?? or in our backend web server ?? or something else like JS policy
Solved! Go to Solution.
Thanks for sharing the trace files for successful and failure responses. I had a look through them and notice both the requests are identical when they are passed on to the target server, but we get 301 when Javascript is used to modify the target URL.
1. For testing purpose, can you please set "target.header.host" in the Javascript with the IP address of the target server and see if that works ?
2. Please do provide the following information:
a) What version of Private Cloud are you using ?
b) Have you set the target URL in the target endpoint definition, to the same value as that in the Location header ? If not, what is the targetURL in the target endpoint definition?
c) Can you please check in your backend server code under what circumstances do you set the Location Header ?
Regards,
Amar