How to properly set bindings in IIS server
I have multiple websites and of course I can't run them all in port 80
so one of my websites is using port 9090
.
I've registered my IP in the domain DNS server and added hostname in the site bindings. But now I can enter my website only like that: http://website.com:9090
. How can I make it open correct website by running http://website.com
?
Solution 1:
There are two main options to run a multiple web sites on a single server like you have described.
Update: Server Name Indication (SNI) changed support for this, allowing supported browsers/servers to access/host multiple TLS protected sites on one IP using host headers to separate them.
Host Header on one IP
IIS can be configured to look at the host header for an incoming request route it to the correct web site even on a single IP address.
This is done by configuring the site bindings and specifying a host name value for all websites on the same IP address. Your web sites will commonly fail to start or generate errors if you have only some of web sites on the same IP bound to a host header. See http://technet.microsoft.com/en-us/library/cc753195%28v=WS.10%29.aspx for more information.
This method does not work for HTTPS i.e. SSL/TLS encrypted. This is because the protocol itself is an encrypted tunnel between IP addresses that does not parse a host header in the tunnel establishment.
Website on individual IP Addresses
Another approach is to separate each website on a separate IP address. This may not be an option available to you for Internet facing websites because you may not have access to more then one IP address. It is great for intranet websites because you can easily troubleshoot issues from the network layer. This option will also work for HTTPS web sites.
To configure this you would:
- Assign an additional IP address to the operating system using network connections and then editing the TCP/IP properties on the network connection. After you have added an addition IP address it will appear in IIS to bind to.
- If you have any existing web sites make sure that they are not bound to the same IP address.
- Add or edit a site binding to the new IP address. See http://technet.microsoft.com/en-us/library/cc771629.aspx
Hope that helps.