I have a EC2 cluster with just one EC2 instance, where two services are running:
api1, listening at port 8080
api2, listening at port 9090
If I make requests against EC2 instance and those ports, both APIs work fine.
Now, I want to create a load balancer so I can make requests against http://{load_balancer_ip}/api1
and http://{load_balancer_ip}/api2
, but I'm not able to.
I have created two target groups, both with just one instance (the only one I have)
TargetGroup1
: Port 8080 and the EC2 instance registered on port 8080TargetGroup2
: Port 9090 and the EC2 instance registered on port 9090
Then, I have created a load balancer with one listener on port 80 and these two path rules:
- When
/api1
, forward toTargetGroup1
- When
/api2
, forward toTargetGroup2
When I make requests against http://{load_balancer_ip}/api1
or http://{load_balancer_ip}/api2
nothing happens; I don't get any response.
What am I missing?