Re: cannot access site by IP - bad request invalid hostname

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: David Wang [Msft] (someone_at_online.microsoft.com)
Date: 09/08/04


Date: Wed, 8 Sep 2004 03:34:36 -0700

Do a network trace of the requests that fail and show that.

I do not understand how your websites are set up at all --
http://xxx.xxx.xxx.70/sitename/defaultdocument
http://xxx.xxx.xxx.70/sitename2/defaultdocument

You call the above two websites, but from IIS perspective, it is one website
(bound to xxx.xxx.xxx.70). Can you give the canonical way to distinguish
between any two of what you call "website"?

i.e.
http://xxx.xxx.xxx.70/sitename/defaultdocument
host: xxx.xxx.xxx.70

vs

http://xxx.xxx.xxx.70/sitename2/defaultdocument
host: sitename2

In any case, it sounds like you have a configuration issue with your
non-standard naming scheme and not with IIS. If you create IIS websites
that listen on certain IP:Port:Host combinations and a request is made with
that information, it's going to be served by IIS. It is when your
networking/server configuration breaks those HTTP rules that you get "Bad
Request", and you must fix them. If you cannot describe your naming scheme
such that it matches how HTTP and IIS works, then a network trace is the
next best thing to show what is going on.

-- 
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Mike" <miked@mediatechproductions.com> wrote in message
news:380c6585.0409071310.16f2bef1@posting.google.com...
I have a windows 2003 server running IIS 6 and am having issues
accessing sites through public IP address. When setting the server up,
I bound a private IP which is NAT'ed to from a public IP via my
router. While in the process of moving sites from my old NT4 box to
the new webserver I would test them by accessing
http://xxx.xxx.xxx.69/sitename/ - which would bring up the default
document so I could test before changing the DNS for these sites. No
problems here.
However, I now have sites that need to go on a different IP address -
the next one in my block. I have NAT'ed another IP I have in my block
(xxx.xxx.xxx.70) to a second private IP which I have bound on the
windows 2003 server. I can get to the server fine through the IP
(although getting IIS error messages), but whenever I try and test a
site through http://xxx.xxx.xxx.70/sitename/ I get a "Bad Request
(Invalid Hostname)" error. If I remove all host headers then IIS pulls
up the site, but only if I reference just the IP address (i.e.
http://xxx.xxx.xxx.70).
The odd thing is that the other IP address I have setup on this server
(xxx.xxx.xxx.69) I can access all of the sites on that IP (about 10
using host headers) through the IP address just fine.
For example:
xxx.xxx.xxx.69 --> x.x.x.188
xxx.xxx.xxx.70 --> x.x.x.189
The xxx.xxx.xxx.69 was setup initially with the server setup.
The xxx.xxx.xxx.70 was added to make room for more sites.
If I need to test one of the sites on the .69 IP address, I can go to
http://xxx.xxx.xxx.69/sitename/defaultdocument to test before changing
DNS - this has worked just fine on every site on this IP - about 10.
If I try and test one of the sites on the .70 IP address, I go to
http://xxx.xxx.xxx.70/sitename/defaultdocument and get "Bad Request
(Invalid Hostname)" error.
Both IP's are setup exactly the same on the router.
Both private IP's are setup the same on the NIC card
Sites in IIS have been setup the same always.
Any ideas or help is greatly appreciated!


Relevant Pages

  • Re: problems with PHP 5 on IIS 5.01
    ... Websites are uniquely named by IP:Port:HostHeader that they bind to, ... you should use the ISAPI version of PHP on IIS. ... I recieve an http 400 - Bad Request error. ...
    (microsoft.public.inetserver.iis)
  • Re: Have no concept, complete un-geek
    ... IIS does not care about DNS at all. ... responds to that request. ... I'm not sure what you mean by IP involved in the setup. ...
    (microsoft.public.inetserver.iis)
  • Re: Page Cannot Be Displayed Errors
    ... In WFetch, for Advanced Request, change to "Add Headers" and write: ... > directly on the web server, ... >>> Where can I get the IIS 6.0 Resource Kit, and how do I use WFetch? ...
    (microsoft.public.inetserver.iis)
  • Re: SSL broken after Windows 2003 upgrade
    ... The svchost.exe you reference is "IIS". ... routes them to the appropriate w3wp.exe based on configuration from WAS ... WFetch can make both a normal SSL request as well as a Client-Certificate ...
    (microsoft.public.inetserver.iis)
  • Re: IIS Extensions in URL causes filter to break.
    ... If your filter operates the way you say, ... IIS can only say that one or more of the events contain ... every request, and maybe more than once, depending on whether the URL causes ... As for the order of handling between ISAPI Extensions and Filters - Filters ...
    (microsoft.public.inetserver.iis.security)