0

I setup an ASP.NET app under IIS as described here: Run ASP.NET 5 (MVC 6) using .NET Core on IIS

Everything works fine when I access the site with "http://localhost:19691/blahblah", BUT if I replace localhost with the machine's internal IP address (http://10.10.38.57:19691/blahblah), connection is refused. Also "127.0.0.1:19691/blahblah" works fine too. I try all this from the same machine that I have IIS on. If I try "10.10.38.57:80" where my IIS root lives I do get the IIS welcome page. Which is what's expected.

I disabled the firewall on the machine. Is there some Kestrel configuration that I am missing?

Community
  • 1
  • 1
Wheel Builder
  • 3,515
  • 5
  • 20
  • 32
  • When you use the IP i think IIS treats that as an external connection rather than as a connection from the same machine, so i'd say check the authentication settings, you might have something that work for internal connections but not external ones – JoaoFSA Apr 15 '16 at 17:03
  • Is your app running in a virtual directory under the Default Web Site or is it a separate web site? – squillman Apr 15 '16 at 17:10
  • it's setup as virtual directory – Wheel Builder Apr 15 '16 at 19:25

1 Answers1

0

To fix this I had create hosting.json file in the root of the project and put the following in it:

{ "server": "Microsoft.AspNet.Server.Kestrel", "server.urls": "http://10.10.38.57:19691/" }

Wheel Builder
  • 3,515
  • 5
  • 20
  • 32
  • I think that configuration API changed and now it is `urls` instead of `server.urls` – kuskmen Nov 24 '16 at 22:43
  • There are a few other places in the project properties debug page (and launchconfig.json) that you may need to update also. – StingyJack Mar 12 '17 at 19:11