Iis – Azure Load Balancer and IIS with multiple websites and host headers

azureiisload balancing

Currently, I have two web servers that each have four unique websites, binded with four unique ports and host headers

  • a.blah.com:81

  • b.blah.com:82

  • c.blah.com:83

  • d.blah.com:84

I also have an Azure External Load Balancer, and the two web servers are in the backend pool. Of course, there is one public IP for the load balancer.

The problem is, even when host headers in IIS are set up correctly, I still cannot seem to get to the different sites. I have made sure to add 80 and 443 in the load balancing rules on the Azure External Load Balancer.

When I am hitting the various URL's above, why isn't the Azure Load Balancer taking me to the right websites in IIS given that host headers are configured?

Please help! Thank you

Best Answer

If you want all sites to work externally without port number just typing HTTP://a.bla.com you'll need 4 public IPs in the load balancer, and DNS set for each host name pointing to its respective IP.

You don't really need to use both host headers and different ports, one or the other alone would work fine but If you need HTTPS with a certificate for the sites then separate ports is better so let's go with that one:

Create 4 probes in the load balancer, one for each port.

Create 4 NAT rules on the load balancer one on each IP and port 80 and map it to the right port for he respective site using the respective probe.

For HTTPS create a second binding on each site with HTTPS and the right certificate in a similar way (ports 443, 444, 445 & 446), then create 4 more NAT rules in the PLB on the respective IP and port 443 going into the respective port for each site. You can use the same HTTP probes, no need to create new ones as you are just using separate bindinds for each site, if HTTP is reachable HTTPS should too.

That should do it...

Related Topic