我认为这是一个SF问题,而不是SO,所以希望我能在这里find答案…
我有一个.Net 4 Web应用程序部署到Windows 2008 / IIS7(开发服务器)和Windows 2008R2 / IIS7.5(产品服务器)。 这个网站运行没有问题。 我们最近不得不向网站添加IP限制,这个限制被设置为“拒绝所有,允许这些”。 从白名单上的IP访问站点是好的,但是从拒绝的IP到应用程序exception结束。 我希望被拒绝的IP的结果是一个403.6响应的标准IIS错误页面,没有请求到达站点,但似乎请求到达站点。 两台服务器都定义了很多网站,并使用基于主机名的绑定。
在开发框中,这里是我当前testing的applicationHost.config文件中的相关条目(prod文件允许条目而不是这个拒绝条目):
<location path="OurSite.Web"> <system.webServer> <security> <authentication> <anonymousAuthentication enabled="true" /> </authentication> <ipSecurity allowUnlisted="false"> <add ipAddress="10.1.3.193" allowed="false" /> </ipSecurity> </security> </system.webServer> </location>
这里是错误信息:
2013-08-26 10:55:07,229 FATAL OurSite.Web (null) [12] System.Web.HttpApplication.RaiseOnError(:0) - An unhandled 'NotSupportedException' exception occurred within the application. System.NotSupportedException: There is no session associated with this context. You should ensure that one has been started by specifying the correct domain alias at OurSite.Data.Dao.Session.NHibernateSessionManager.CommitTransaction() at OurSite.Web.HttpModule.AbstractNHibernateSessionModule.CommitAndCloseSession(Object sender, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
你可以看到请求已经到达了这个站点,而不是通过正常的方式,因为从来没有创buildNHibernate会话。 应用程序不指定任何自定义错误(自定义错误部分设置为关)。失败的请求日志为空。
如果任何人都可以指出什么是错误的,无论是设置或我的理解如何工作,这将非常感激!
谢谢。