How to Route Traffic to Multiple Microservices with AWS API Gateway

I recently set up AWS API Gateway to forward requests to two different microservices. Hereβs how I did it step by step π
The Goal
I had two backend services behind their own load balancers:
- User Service:
http://user-lb-1148255498.ap-south-1.elb.amazonaws.com - Order Service:
http://order-lb-1634505146.ap-south-1.elb.amazonaws.com
I wanted:
/api/usersβ User service/api/ordersβ Order service- Any extra path after these (like
/health) should also go to the correct service.
Step 1: Create an HTTP API
- Go to API Gateway β HTTP API β Create API.
- Choose Manual route configuration.
- Give it a name like
MicroserviceGateway. - Choose HTTP integration.
- Add both services one by one:
User Service Integration:
- URL:
http://user-lb-1148255498.ap-south-1.elb.amazonaws.com - Proxy URL:
http://user-lb-1148255498.ap-south-1.elb.amazonaws.com/{proxy}
Step 2: Add Routes and Connect Integrations
For each service, create two routes β one for the base path and one for everything after it.
User Service
/api/usersβ Integration: User LB/api/users/{proxy+}β Integration: User LB
Note:
{proxy+}means it will forward any subpath after the main route to the backend. For example,/api/orders/healthgoes to/healthon the Order service.
Step 3: Deploy the API
- Go to Deployments β Create Deployment.
- Create a stage named
prod. - Click Deploy.
Youβll now get a single URL like this:
https://abc123xyz.execute-api.ap-south-1.amazonaws.com/prod
π Step 4: Test the Setup
Try calling these endpoints to confirm they route correctly:
/prod/api/usersβ goes to User service/prod/api/users/healthβ goes to User service /health/prod/api/ordersβ goes to Order service
π‘ Key Tips
- Always add both: A base route and a proxy route.
- Use
{proxy+}: To catch all subpaths effectively. - Set method = ANY: To allow GET, POST, PUT, etc., to flow through.
- Test Backends First: Confirm your LBs are reachable before connecting them.
β Thatβs it! Now you have a single API Gateway URL that routes traffic cleanly to multiple microservices.
Keep Reading

Shubham
Full Stack Developer
