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 inval
If working on local server or you haven't got domain name, delete "Host Name:" field.
You can use Visual Studio 2005/2008/2010 CMD tool. Run it as admin, and write
aspnet_regiis -i
At last I can run my app successfully.
FWIW, if you'd like to just allow requests directed to any hostname/ip then you can set your binding like so:
<binding protocol="http" bindingInformation="*:80:*" />
I use this binding so that I can load a VM with IE6 and then debug my application.
EDIT: While using IIS Express to debug, the default location for this option's config file is
C:\Users\{User}\Documents\IISExpress\config\applicationhost.config
I'm not sure if this was your problem but for anyone that's trying to access his web application from his machine and having this problem:
Make sure you're connecting to 127.0.0.1
(a.k.a localhost
) and not to your external IP address.
Your URL should be something like http://localhost:8181/
or http://127.0.0.1:8181
and not http://YourExternalIPaddress:8181/
.
When you connect to your external IP address, you connect to you from the internet, as if you were a stranger (or a hacker).
However when you connect to your localhost, you connect locally as yourself and the block is obviously not needed (& avoided altogether).
I got this error when I tried to call a webservice using "localhost". I fixed it by using the actual IP instead (192.168...)
So, I solved this by going to my website in IIS Manager and changing the host name in site bindings from localhost to *. Started working immediately.