rachit_verma
rachit_verma

Reputation: 321

Path based routing not working on AWS Application load balancer

It was only recently that I began working on AWS , and I had been trying out AWS application load balancers

I have two target groups each with EC2 instances with index.html pages routed at /index.html.

I created an AWS application load balancer , connected to those two target groups.

However when I tried to do Path Based Routing on the ALBs and tried to access those paths all I got was a 404 error

I have tried the following rules individually and together.

The default target group however is working , and all the target groups have healthy instances. Paths tried out

Upvotes: 1

Views: 2872

Answers (2)

JamesFrost
JamesFrost

Reputation: 769

The instance in TG2 will need to have a page at /tg2, as that is the path being requested.

You do not need the 'Http header' rule for path based routing, as your existing Path rule should cover this. In addition, this rule does't make sense - there is no HTTP header named GET.

Upvotes: 1

Aravind
Aravind

Reputation: 59

Before you going to enable Path based routing make sure to check that path is available in your all EC2 instances, and then modify the health checks as same as your path. Ex : If I wanted to connect to /user.html instead of /index.html

  1. Make available of user.html in all EC2 Instances
  2. Modify or create another target group with health checks of /user.html
  3. Configure the Path based Route in an ALB Lister. Now you are all set.

Upvotes: 2

Related Questions