Search code examples
iisasp.net-web-apiwindows-server-2016

IIS 10 connect to a WebApi project using IP address and not host name


  • IIS 10, WebAPI 2, Windows Server 2016

I have deployed my application to the server and have an IIS binding of:

enter image description here

The host name is not world accessible so I added an entry to hosts to map it:

blah.foo.com 10.4.2.116

Using http://blah.foo.com locally on the machine I can make a connection to both the underlying MVC and WebAPI.

However if I go to 10.4.2.116 IIS returns a 404. So my question is how do I configure IIS to respond on that internal 10.x.x.x IP address?


Solution

  • Using an empty host name and then Type: HTTP, Port: 80, IP Address: 10.4.2.116 is how you do this in IIS GUI.