Did you inspect the binding is IIS? (inetmgr.exe) It may not be registered to expropriate all hostnames ~ above 8080.

You are watching: Http error 400 the request hostname is invalid

For example, if you collection it up because that mysite.com:8080 and also hit it at localhost:8080, IIS will gain the request however not have a hostname binding to match so it rejects.

Outside the that, friend should inspect the IIS logs (C:inetpublogswmsvc#) top top the server and also see if you room seeing your request. Climate you"ll understand if that is a problem on your client or ~ above the server itself.

See more: American Factory Workers In Early Nineteenth-Century Textile Mills Largely Consisted Of


*

Step 1: add Inbound dominion of windows Firewall

*

Open the Windows Firewall with advanced Security. At the left panel, right click Inbound Rule > New Rule Rule Type: harbor Protocol and Ports: TCP Specific regional ports: 57976 Action: permit the link Profile: tick all (Domain, Private, Public)Name: Name, Description(optional)Finish.

Step 2: IIS or IIS Express

Add Bindings of IIS Manager

*

Open the IIS Manager. At the left panel, walk to Sites > Default net Sites.At the best panel, click on the Bindings. Then, the brand-new dialog popular music ups.At the pop-up dialog, click the "Add" buttons. Input the port number and the hostname.For mine case, port = 57976;hostname = 192.XXX.XXX.XXX (my IP address)

Add Bindings of IIS express (Visual Studio)

*

Stop the existing Site because that Visual Studio 2015, adjust the IIS config under your task folder C:Projects.vsconfigapplicationhost.config‌​.For previous version of visual Studio 2015, adjust the IIS config under IIS express folder C:UsersDocumentsIISExpressconfigapplicationhost.config

In applicationhost.config, find by the port number (for my case is 57976), climate one more binding with your IP resolve

Updated:

For windows 10 or intuitive Studio 2015 users,you may get the error post below:

Unable to launch the IIS Express net server, failed to it is registered URL, accessibility is deniedSolution:

Close visual Studio Right click Visual Studio > operation asAdministrator

Reference: https://azure.microsoft.com/en-us/documentation/articles/mobile-services-dotnet-backend-how-to-configure-iis-express/