0

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.

  1. licence.example.com/api -> Target Group B
  2. licence.example.com -> Target Group A

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?

1 Answer 1

2

Two problems.

  1. 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.

  2. 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.

Sign up to request clarification or add additional context in comments.

1 Comment

Hi @Matt can you please have a look at this question stackoverflow.com/questions/58640453/… Any input would be highly appreciated

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.