Reputation: 541
Can a elastic load balancer work on top of a beanstalk app and route traffic based on path in url?
Here is how my app is structured
Frontend App (separate repository- just html js css)
Landing Page (separate repository- just html js css)
Admin Panel (separate repository- just html js css)
API (separate repository - node.js / express app)
I want to setup the infrastructure on AWS, since i was on heroku before, i like to have beanstalk for all the sugar it gives me for free. so i am thinking to make separate 4 beanstalk apps
1. Frontend (Beanstalk app. - Single Instance)
2. Landing Page (Beanstalk app. - Single Instance)
3. Admin Panel (Beanstalk app. - Single Instance)
4. API (Beanstalk App - Autoscaling with a LoadBalancer)
and i want
mydomain.com/ to redirect to landing page.
mydomain.com/www to redirect to Frontend.
mydomain.com/admin to redirect to Admin Panel.
mydomain.com/api to redirect to the API beanstalk app.
I can do all of them individually, can you help me figure out how to redirect traffic based on the path in url?
Upvotes: 0
Views: 64
Reputation: 903
A beanstalk application, if it is more than a single server, is going to have it's own load balancer per application, that's just part of the stack. It will add/remove servers from the load balancer as it scales up and scales down. So, in your scenario you're going to have 4 load balancers. This is probably going to be the simplest option.
If each of your beanstalk applications are just a single server, then there isn't going to be a load balancer created by default. So, in theory you could use an Application Load Balancer. Application Load Balancers can route to the proper server based on the path, or other criteria. But, if the servers are ever replaced, you'd need to manually remove/add servers to the load balancer, or do some automation to do that for you.
Upvotes: 1