404 error with plain html always from AWS alias target endpoint

When I use a Target URL as https://xxxxxxxxxxxxxx-ppe.api.tescocloud.com/orderFulfilment the configuration doesn't work. I get a 404 response.(attached the screenshot) This is a fully working URL as it is tested from local machine and browser.

When I use the Target URL as https://xxxxxxxxxxxxx.eu-west-1.elb.amazonaws.com/orderFulfilment/ it works. Since this configuration works, the IP whitelisting for APIGEE seems to be correct. And hence the access to the actual application server seems to be possible.

https://xxxxxxxxxxxxxxxxxxxx.eu-west-1.elb.amazonaws.com/orderFulfilment/ is basically the underlying AWS ELB URL for the above domain URL. i.e., in the AWS hosted zone for the Alias record of https://xxxxxxxxxxxxxx-ppe.api.tescocloud.com/orderFulfilment, https://xxxxxxxxxxxxxxxxxxxxx.eu-west-1.elb.amazonaws.com/orderFulfilment/ is configured as the target.

Hence I think there is some issue internally in APIGEE resolving the host xxxxxxxxxxxxx-ppe.api.tescocloud.com. Which is leading to APIGEE generating the 404 response. I also noticed the response body in the 404 response seems to be specially crafted as some default response.

This is definitely not part of the target. Hence feels like where ever this response is getting generated is the place that we have to look for. Any help will be highly appreciated.

The Body of the 404 response looks as follows:

<!DOCTYPE html> <html> <head> <title>Error</title> <style> body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style> </head> <body> <h1>An error occurred.</h1> <p>Sorry, the page you are looking for is currently unavailable.<br/> Please try again later.</p> </body> </html>

7433-404.png

7434-html.png

Regards

Nandeesha

0 2 762
2 REPLIES 2

Not applicable

I am facing similar issue , could you or anyone please post how that/this issue been resolved ??

Hi @Nandeesha, you are no trimming/removing the pathSuffix before hitting your AWS Target. Due to which the path is being APPENDED to the AWS target and hence resulting in 404.

7674-proxyuri.jpg

On TargetEndpoint Preflow add an Assign Message Policy,

<AssignMessagename="AssignMessage.DisablePathCopy">
    <AssignVariable>
       <Name>target.copy.pathsuffix</Name>
       <Value>false</Value>
    </AssignVariable>
</AssignMessage>

or a Simple Javascript Policy,

context.setVariable("target.copy.pathsuffix", false)