Reputation: 38879
I have a fairly comprehensive application load balancer set up that routes based on host name.
However, I'm trying to introduce the following but can't get the path routing to work.
i.e. I have them in this order.
What I'm seeing is everything is routed to Target Group A.
I have Rule 1 set to host licence.example.com, path: /api/* And Rule 2 set to host licence.example.com
I've tried changing the order by swapping them around. And I've tried adding a path to rule 2 as /* but it doesn't work.
Is the AWS load balancer not capable of this most basic configuration? Am I going to have to throw it out and use nginx?
Upvotes: 0
Views: 2775
Reputation: 38879
Two problems.
The order displayed in the UI is important. Rules higher up are list are a higher priority. So first I had to ensure the match with the path occurred first.
The requests to /api/* come through to the application with the path /api/ included. No rewrite like nginx which would strip it off. So the fix was to make a small change to the app listening at Target Group B to expect the /api/ path. I made this a config value and then it all worked.
Upvotes: 2