Héctor Valls
Héctor Valls

Reputation: 26084

AWS Application Load Balancer not working

I have a EC2 cluster with just one EC2 instance, where two services are running:

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)

  1. TargetGroup1: Port 8080 and the EC2 instance registered on port 8080
  2. TargetGroup2: 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 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?

Upvotes: 1

Views: 11543

Answers (1)

Héctor Valls
Héctor Valls

Reputation: 26084

Ok, I found what's happening thanks to this question's first comment:

AWS Application Load Balancer (ALB) path based routing not functioning as expected

Load balancer is not rewriting the URL and my APIs are listening at /, but load balancer is redirecting all the path /api1.

Solved!

(I couldn't mark it as duplicated because question above does not have any accepted answer)

Upvotes: 2

Related Questions