0

I have 2 EC2 instances and an Application Load Balancer.

The Load is not too high, but I'm keeping both instances working just in case. Plus, it saves the time on deployment with (one at a time) and still provides "no downtime".

Now I need to add another project.

I'd like to use my EC2 instances and only create a new Load Balancer for it.

Can I do it?

I mean, I can place projects in folders in EC2, but I cannot find a way to set Load Balancer to use a specific folder instead of the root.

My best guess now is to set Nginx to use port 80 for first project and 81 for the second one. But I haven't try it yet. Is there a better way? Are there any hidden problems?

1 Answer 1

1

You can archive that, but you will need to use the Application Load Balancer (ALB) which allows you to create rules (like HTTP URL paths, host header conditionals, query strings, HTTP method) to forward the traffic to a specific pool of servers that on your case would be those 2 EC2 instances.

e.g.:

/app1 --> :/app1 /app2 --> :/app2

Notice that you should have the ALB rule like this: /app1/* and /app2/*

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.