I have a system where I use a load balancer to do path-based redirects where depending on the path, it will redirect to a different domain or EC2 app. 8 The way I have it set up now, all HTTP requests get forwarded to HTTPS, and that works fine.
For all HTTPS requests, I want it so that a path to www.abc.com/* always gets redirected to www.abc.app/* EXCEPT for one path, which is www.abc.com/game
I have two listeners setup:
- www.abc.com/game gets routed to a target group that is linked to an EC2 instance hosting a nodejs app. I can access this through port 3000 fine using the native EC2 IP. This is the highest priority listener
- The last priority listener takes the HTTPS://#{host}:443/#{path}?# pattern and redirects it to www.abc.app/*
The issue is, listener #1 seems to be completely ignored because the www.abc.com/game path gets redirected to www.abc.app/game instead of routing it to the EC2 server.
I checked my conditional logic and I have it as the following: If abc.com/game OR www.abc.com/game OR variations containing the "https" prefix then redirect to EC2 target group
Is there any clue as to why this listener is not triggering?
You should set the rule to have a
host headercondition and then apathcondition as in the screenshot below:This is the high priority rule. You can also forward if there is any suffix to /game by using below rule: