Search code examples
asp.netamazon-web-servicesiisamazon-elastic-beanstalkvirtual-directory

AWS Load Balancer and IIS Virtual Directory


I am migrating a project to the cloud with the aim to load-balance the website.

It is currently .NET Core app hosted on IIS, but there is a Virtual Application attached to this site in IIS (for a very old MVC3 application):

www.mysite.com hits the .NET Core app

But

www.mysite.com/blog hits the completely separate MVC app.

I want to dockerise my application and run it behind Elastic Beanstalk, or even just some EC2 instances behind a load balancer, but how can I take care of the "blog" app in this scenario? It 100% doesn't need to be load balanced and I don't want to make it part of the deployment strategy, since it is a simple CMS and the code hasn't been re-deployed for years!

EDIT: I'm thinking the Load Balancer provided by AWS must be the thing I am looking for, since it will be linked to the DNS entry and as it is effectively a reverse proxy, I should be looking to see if I can configure the Load Balancer to add a rule to reverse proxy the request into one of my EC2 boxes?


Solution

  • how can I take care of the "blog" app in this scenario?

    You can use Application Load Balancer. You can have different listeners handling different URLs (e.g. one listener handles www.mysite.com and another one handles /blog).
    You can add more sophisticated rules for /blog to forward its handling to different target groups.
    Target groups can contain ECS, EC2 and whatever you need.