IIS网站使用localhost但不能使用IP地址或域名

时间:2019-03-04 01:29:10

标签: c# asp.net-mvc iis

我访问配置为使用Windows身份验证的.NET网站时遇到问题(站点与表单身份验证配合正常)。每次尝试使用正确的域名或IP地址访问该站点时,我都会收到401条授权消息,但是通过localhost访问该站点时可以按预期工作

Below is my web.config(authentication node)

Site When accessed over Localhost

Windows authentication / ASP.net impersonation enabled in IIS

我对applicationhost.config进行了一些更改,但没有一个给我想要的结果。 Applicationhost.config

我也尝试过以下URL中提到的项目,但运气不佳。 https://support.microsoft.com/en-gb/help/896861/you-receive-error-401-1-when-you-browse-a-web-site-that-uses-integrate

https://support.microsoft.com/en-us/help/303650/intranet-site-is-identified-as-an-internet-site-when-you-use-an-fqdn-o

https://support.microsoft.com/en-us/help/258063/internet-explorer-may-prompt-you-for-a-password

如果任何人遇到此问题,请提供帮助。

仅供参考, 我已将此站点托管在AWS上,并且出于测试目的,已启用来自所有IP的传入https / https通信。 服务器:Windows Server 2016 IIS:IIS 10

1 个答案:

答案 0 :(得分:0)

我终于能够通过从NTLM切换到Kerberos并通过     创建适当的SPN条目。     还必须将站点添加到本地Intranet站点

Below is the link that I referred.

https://blogs.msdn.microsoft.com/chiranth/2014/04/17/setting-up-kerberos- 
authentication-for-a-website-in-iis/

https://blogs.msdn.microsoft.com/askie/2012/06/05/how-to-configure-internet-explorer- 
security-zone-sites-using-group-polices/

Had to additionally do this for Firefox

Enter about:config and modify a couple of entries.
network.negotiate-auth.delegation-uris
network.negotiate-auth.trusted-uris
network.automatic-ntlm-auth.trusted-uris
Enter my domain on these settings