504 Gateway Timeout issue in Hosted Target

I have a working JavaScript in my local NodeJS terminal with a https:// endpoint. I created "Hosted Proxy" and uploaded the similar dependency (that contained in package.json).

Not sure why I am receiving 504 error in the proxy, during the test.

Does it work different way in the proxy compare to local terminal, any additional configuration required please advise?

Thanks much!!

Solved Solved
0 4 434
1 ACCEPTED SOLUTION

Hi Ravi,

504's are most likely due to a Hosted Target taking longer than 60s to complete a request, see our 504 troubleshooting section. Assuming you are listening on the correct PORT env var, this can sometimes be due to a slow backend or a backend that has IP whitelisting (which is not advised when using Hosted Targets).

View solution in original post

4 REPLIES 4

Hi Ravi,

504's are most likely due to a Hosted Target taking longer than 60s to complete a request, see our 504 troubleshooting section. Assuming you are listening on the correct PORT env var, this can sometimes be due to a slow backend or a backend that has IP whitelisting (which is not advised when using Hosted Targets).

Hi @Kyle Wiese

Thanks for you reply. I missed to include the listening port, I have added it and 504 is gone now.

But I am receiving 404 error now.


A 404 is an application-level error and something you'll need to resolve yourself. There is no state that a HT can be in where the Apigee upstream will report a 404 unless the HT itself is responding with a 404.

Yes, it could be the case. When I added the listening port it turns out to be a 404 (and I have attached the trace, it says cannot GET). It happens to be say error description when I try my JS in online JS tool, but the calls are still going to backend and data is retrieved.

Not sure, but I don't think the problem could be backend IP whitelisting. Looks more to be a configuration error in the HT. I want to share the HT proxy to you, but don't see any option to do it in private?capture.png