All Products
Search
Document Center

API Gateway:What do I do if my API Gateway instance failed to forward an API request to the backend service?

Last Updated:Feb 27, 2024

  • Check whether the URL of the backend service is correct.

  • Check for connectivity issues between API Gateway and your backend service.

  • If you are using an internal IP address, make sure that your backend service is deployed in the same region as your API.

  • Check the backend service timeout period in the API definition.

    When you create an API, you are required to specify a backend service timeout period. If your backend service does not return a response within the specified period, API Gateway prompts you that the backend service cannot be connected. You can specify a timeout period based on the time required by the backend service to process a request. You can set a period up to 30,000 ms for an API on a shared instance and up to 120,000 ms for an API on a dedicated instance.

    Note

    Take note that the unit of the timeout period is milliseconds (ms).

    You cannot set the timeout period to 0. For more information about the timeout period, see Configure timeout periods for TCP connections.

  • If your backend service is deployed on an Elastic Compute Service (ECS) instance, check the security group settings on the ECS instance to make sure that the instance can be accessed from the egress CIDR block of your API Gateway instance.

Take note that the egress IP address of an API Gateway instance changes. As a result, the ECS instance denies access if the new egress IP address is not allowed access by the security group settings on the ECS instance. Therefore, we recommend that you use the backend signature verification mechanism provided by API Gateway to authenticate caller identities. This mechanism eliminates such risks. For more information, see Backend signature plug-ins

View the egress IP address of an API Gateway instance:

Perform the following steps to view the egress IP address:

1. Log on to the API Gateway console. In the left-side navigation pane, choose Manage APIs > API Groups. Then, click the desired API group and record the ID of the instance on which the group resides on the group details page.

2. On the left-side navigation pane, choose Instances and Clusters > Shared Instances or Instances and Clusters > Dedicated Instances based on your instance type to view the egress IP address of your instance.