IIS 7.5 returning 404 for unknown host names

Posted by WaldenL on Server Fault See other posts from Server Fault or by WaldenL
Published on 2012-06-01T23:51:43Z Indexed on 2012/06/04 16:45 UTC
Read the original article Hit count: 252

This just doesn't seem correct to me, so I'm looking for someone to tell me how I've misconfigured IIS... Configuration is IIS7.5 (2008R2), without SP1.

I have IIS 7.5 configured w/several sites. ALL sites have hostnames defined in the bindings, there is NO site w/out a hostname. However, if I request an unknown hostname from the server IIS (technically Microsoft-HTTPAPI/2.0) return a 404 error, not a 400 error. I would expect a 400 (or some other major error) rather than a lowly 404.

This causes a problem when I have nginx in front of multiple IISs and want to stop a site so nginx takes it out of rotation. Since IIS still returns a 404 for the request even when there is no active site for that name, nginx doesn't know the server is dead.

NB: IIS returns the 404 regardless of whether there is a server, but it's stopped, or there is no server.

Thoughts? Solutions?

-- Additional info: OK, I added a site on a port other than 80 (5000) and then on a connection to that port asked for a site that doesn't exist, and I get the expected error 400 (Invalid hostname). So, while IIS isn't listening for generic (no host name) connections on port 80 it would seem that something is. Any ideas how to get HTTPSys to dump the list of what it's listening for?

© Server Fault or respective owner

Related posts about iis

Related posts about windows-server-2008-r2