Goal:
Run two websites on my home network, behind my router, that each have their own domain name using my one IP address from Comcast without having to type port numbers in for the URL.
Setup:
I'm running IIS6 on a Windows Home Server behind my D-LINK DI-624 router. I have the router configured to forward WAN requests to the router on port 80 to go to the Windows Home Server. On the Home Server I have my two websites configured with these web identities.
Site1: IP - (All Unassigned), Port - 80, Host Header - www.site1.net
Site2: IP - (All Unassigned), Port - 81, Host Header - site2.homeserver.com
Results:
Site1 works fine using the domain name. Site2 does not work properly and instead I get a "Bad Request (Invalid Hostname)" error message. If I swap ports on the sites, the reverse happens, basically whichever port is not on port 80 won't work.
Hypothesis:
Researching this issue I found common causes of this are browsers sending HTTP 1.0 requests that don't support the host header info or that IIS is not receiving the host headers in the HTTP requests, i.e. they are getting stripped out somewhere along the way.
I know my browser was using HTTP 1.1 so I investigated the latter and upon reviewing the IIS logs it would seem the host header info is getting ripped out before it gets to IIS. My entries look like this when I try to hit Site2.
2009-07-29 03:35:51 68.40.123.123 60491 192.168.0.100 80 HTTP/1.1 GET /home/default.aspx?gotodefault=true 400 - Hostname -
2009-07-29 03:35:54 68.40.123.123 60492 192.168.0.100 80 HTTP/1.1 GET /favicon.ico 400 - Hostname -
I'm assuming the Hostname should have an entry with the requested domain. I'm far from a networking guru but my guess is that the HTTP host headers are getting stripped out by my D-LINK router when it does the port forwarding.
Questions:
1. Can anyone confirm if routers typically do this as part of port forwarding?
2. I'm considering upgrading my router anyway, are there routers that preserve the host header info through port forwarding? I've tried Googling but haven't had much luck finding info about this topic.
3. I have another router-turned-wifi-bridge running the DD-WRT firmware. That firmware seems rather robust, does anyone know if that supports preserving host header info through port forwarding?
4. Are there any other solutions that would be relatively easy to implement that would achieve my stated goal?
Thanks in advance for your time.
Run two websites on my home network, behind my router, that each have their own domain name using my one IP address from Comcast without having to type port numbers in for the URL.
Setup:
I'm running IIS6 on a Windows Home Server behind my D-LINK DI-624 router. I have the router configured to forward WAN requests to the router on port 80 to go to the Windows Home Server. On the Home Server I have my two websites configured with these web identities.
Site1: IP - (All Unassigned), Port - 80, Host Header - www.site1.net
Site2: IP - (All Unassigned), Port - 81, Host Header - site2.homeserver.com
Results:
Site1 works fine using the domain name. Site2 does not work properly and instead I get a "Bad Request (Invalid Hostname)" error message. If I swap ports on the sites, the reverse happens, basically whichever port is not on port 80 won't work.
Hypothesis:
Researching this issue I found common causes of this are browsers sending HTTP 1.0 requests that don't support the host header info or that IIS is not receiving the host headers in the HTTP requests, i.e. they are getting stripped out somewhere along the way.
I know my browser was using HTTP 1.1 so I investigated the latter and upon reviewing the IIS logs it would seem the host header info is getting ripped out before it gets to IIS. My entries look like this when I try to hit Site2.
2009-07-29 03:35:51 68.40.123.123 60491 192.168.0.100 80 HTTP/1.1 GET /home/default.aspx?gotodefault=true 400 - Hostname -
2009-07-29 03:35:54 68.40.123.123 60492 192.168.0.100 80 HTTP/1.1 GET /favicon.ico 400 - Hostname -
I'm assuming the Hostname should have an entry with the requested domain. I'm far from a networking guru but my guess is that the HTTP host headers are getting stripped out by my D-LINK router when it does the port forwarding.
Questions:
1. Can anyone confirm if routers typically do this as part of port forwarding?
2. I'm considering upgrading my router anyway, are there routers that preserve the host header info through port forwarding? I've tried Googling but haven't had much luck finding info about this topic.
3. I have another router-turned-wifi-bridge running the DD-WRT firmware. That firmware seems rather robust, does anyone know if that supports preserving host header info through port forwarding?
4. Are there any other solutions that would be relatively easy to implement that would achieve my stated goal?
Thanks in advance for your time.