0
votes

I'm trying to configure path based routing within my Application Load Balancer. I have three target groups configured against a single ECS Instance, however when I call one of the specific paths on the ALB, I just get a 404.

I can call the three containers directly (i.e. http://somehost:xxxx) and I can swap the target of the last rule to any of my targets so I think I have something messed up with the paths but I can't figure it out.

Here are the ALB Listener rules: HTTP : 80

  1. Path is /curly* ==> Forward to app1-tg
  2. Path is /larry* ==> Forward to app2-tg
  3. Path is /moe* ==> Forward to app3-tg

Does anyone have any suggestions?

1

1 Answers

1
votes

Mike,

I know this is an old post but it may help someone. Solved a similar issue recently.

The goal is having 1 x AWS IIS host instance running 2 x apps as separate website containers, load balaced in AWS across 2 AZ’s for fault tolerance and high availability.

We needed to be able to target either app on the host by using app name in the URL, appened to the load balance address. I got this working by doing 2 things:

The actual physical path that the container code exists in, has to differ for the rule path to work. i.e. The addition of /app1 or /app2 to the LB rule won’t work unless the path on the box has actually has /app1 or /app2 in the folder path.

So I recoded the .json that creates the containers to put the basic index.html in /app1/index.html and the same for app2.

The url path I was using in “IF path” was of the form “[my LB DNS]/app1” and “[my LB DNS]/app2" — for whatever reason, the LB wouldn’t recognise these as valid paths. So I amended the “IF path” to just “/app1/” and /app2/

So now — pasting in the load balance url and adding /app1 or /app2 at the end works and directs the browser to the relevant container for “Hello from App1” or “…App2”