Bad Request - Invalid Hostname IIS7

burnt1ce picture burnt1ce · Jan 28, 2011 · Viewed 196.2k times · Source

When I try to hit my web app on port 8080 I get the following error

Bad Request - Invalid Hostname
HTTP Error 400. The request hostname is invalid.

I don't even know where to begin to diagnose this problem

Answer

Taylor Bird picture Taylor Bird · Jan 28, 2011

Did you check the binding is IIS? (inetmgr.exe) It may not be registered to accept all hostnames on 8080.

For example, if you set it up for mysite.com:8080 and hit it at localhost:8080, IIS will get the request but not have a hostname binding to match so it rejects.

Outside of that, you should check the IIS logs (C:\inetpub\logs\wmsvc#) on the server and see if you are seeing your request. Then you'll know if its a problem on your client or on the server itself.