IIS7, different ports for websites but no portnumber in the browser

iis-7port

I have a windows server 2008 with IIS7 with 4 websites. In DNS I have 4 different URLs which point to the IP of the server. I configured each web site with the site bindings:

website1:
hostname: url1, port: 80, IP-Adresse: the adress of the server

website2:
hostname: url2, port: 80, IP-Adresse: the adress of the server

The result is, that from the client, I can browse with all the 4 URLs to the specified web sites and everything is fine.

Then I changed in IIS the port of the websites, so that website1 now uses port 8080, website2 uses port 8081, and so on. Now I have to use the browser with the url and the portnumber (like URL:8080).
Is there a possibility, to configured the websites with different portnumbers but not to use the portnumbers in the browser?

Best Answer

Yes, but only if your environment includes a NAT firewall/router and multiple external IP addresses.

For http connections, the port number is optional on the browser only if the browser is connecting on port 80. Therefore, the browser would need to connect to port 80 in order for the port number to be optional in the URL.

Here is one possible scenario:

  1. You control the 101.101.101.0/20 subnet.
  2. website1.com: DNS "A" record points to 101.101.101.2
  3. website2.com: DNS "A" record points to 101.101.101.3
  4. Your IIS7 server has a local IP address of 192.168.0.67
  5. Firewall/router has a NAT rule redirecting 101.101.101.2:80 to 192.168.0.67:8080
  6. Firewall/router has a NAT rule redirecting 101.101.101.3:80 to 192.168.0.67:8081

With the firewall/router configured in this way, the browser clients would think they were connecting on the standard port 80, so no port number would need to be used in the external URL. However, the connections would be routed to ports 8080 and 8081, respectively, on your private network.

Is there a specific reason why you would like to use non-standard ports on the web server without requiring them to be entered as part of the URL?

Related Topic