Mihai
Mihai

Reputation: 2760

Amazon Elastic Load Balancer with IIS

I have and ASP.NET MVC application hosted under IIS on a EC2 Instance. I can access the application without any problems through the EC2 DNS once I set the proper binding in IIS

http - EC2 DNS - port 80

But if I add an Elastic Load Balancer and then I try to access that web application through the Load Balancer DNS the only way I can get it working is by adding an empty binding in IIS

"empty host name for http:80"

But this can't be ok. If I don't add this the ELB sees my instance as unhealthy and when I access the ELB DNS I just get a HTTP 503 Service Unavailable.

The EC2 instance is in a Auto Scaling group. I've tried modifying the security group of that instance from allowing all IPs for HTTP:80 to only allowing the Load Balancer Ip (amazon-elb/amazon-elb-sg)

Any ideas what I'm doing wrong?

Thanks

Upvotes: 0

Views: 2899

Answers (1)

slayedbylucifer
slayedbylucifer

Reputation: 23512

I am running several IIS servers behind ELB. Here are things that you need to ensure:

  1. The ELB security group is allowed to accept port 80 traffic from anywhere (0.0.0.0/0)
  2. The ELB security group is allowed to send outbound port 80 traffic to your EC2 instance where IIS is running. This point was valid for the ELBs that are set inside VPC. Hence please ignore this.
  3. The EC2 security group of the EC2 instance where you have IIS running, should be allowed to accept port 80 traffic from the Load Balancer.

If this whole set-up is in VPC then there are few other things you need to check. so let us know if this is the case

No configuration changes on IIS are needed for sure.

Upvotes: 1

Related Questions