You may need to look at the proxy timeout configs in nginx if using nginx as a proxy:
http://www.nginxtips.com/504-gateway-time-out-using-nginx/
http://wiki.nginx.org/HttpProxyModule
proxy_connect_timeout 60;
proxy_read_timeout 120;
Apigee timeout defaults:
Connect timeout - 60s - connect.timeout.millis
Read timeout - 120s - io.timeout.millis
FYI Apigee timeouts are also configurable (in milliseconds) within the TargetEndpoint connection:
<HTTPTargetConnection>
<Properties>
<Property name="connect.timeout.millis">5000</Property>
<Property name="io.timeout.millis">5000</Property>
</Properties>
<URL>http://www.google.com</URL>
</HTTPTargetConnection>
Depending on how long the server takes to respond can determine your ideal timeout configurations. In this case, a read timeout of 45-60s might be ideal to provide some buffer in case cloudstack slows down more.