在服务器上运行 MVC3 应用程序会导致 403.14 响应
我正在尝试让 MVC3 应用程序在 Windows Server 2008 R2 机器上运行。服务器运行 IIS 7.5。该应用程序设置了匿名身份验证和 v4.0 框架应用程序池。我已授予 IUSR 和 IIS_IUSRS 对该目录的访问权限,直到我切换到使用服务帐户。
我已尝试以下操作:
- 使用 IIS 注册 ASP.NET 4 (%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -ir)
- 我已从 http://www.asp.net/mvc/mvc3。
我仍然收到 HTTP 403.14 响应:“HTTP 错误 403.14 - 禁止 Web 服务器被配置为不列出该目录的内容。”
如果我放入一个虚拟的 index.html 文件,该页面就会得到服务。在我看来,模块不会拦截该请求以将该请求指向 答案:虽然 MartinHN 的答案确实解决了这个问题,但由于他的回答,我开始
进行一些搜索,发现有一个 IIS7 修补程序可用。这将允许ASP.NET 4 应用程序无需为每个请求运行所有模块即可处理无扩展名的 URL,此修补程序位于:http: //support.microsoft.com/kb/980368。安装此修补程序后,我的应用程序按预期提供内容,无需更改 Web.config。
I am trying to get an MVC3 application working on a Windows Server 2008 R2 box. The server is running IIS 7.5. The application is setup with anonymous authentication and a v4.0 framework application pool. I have given IUSR and IIS_IUSRS access to the directory until I switch to using a service account.
I have tried the following:
- Registered ASP.NET 4 with IIS (%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -ir)
- I have installed MVC3 on the server from http://www.asp.net/mvc/mvc3.
I am still receiving an HTTP 403.14 response: "HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory."
If I throw in a dummy index.html file, the page gets served. It seems to me like a module isn't intercepting the request to point the request to the home controller.
Answer: While MartinHN's answer did resolve the issue, it would result in a performance hit when serving static files. Thanks to his answer I started doing some searching and found that there is a IIS7 hotfix available which will allow ASP.NET 4 applications to handle extensionless URLs without running all modules for each request. The hotfix is available here: http://support.microsoft.com/kb/980368. After installing this hotfix my application was serving content as expected, without the Web.config change.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能是以下之一...
检查您的 web.config 中的行:
并确保应用程序池设置为集成管道。
您还可以尝试重置 IIS 中的处理程序映射。点击站点-->处理程序映射 -->恢复到父级(链接应位于右侧边栏)。
Might be one of the following...
Check your web.config for the line:
And make sure that the application pool is set to the Integrated Pipiline.
You can also try to reset the Handler Mappings in IIS. Click the site --> Handler Mappings --> Revert to parent (link should be on the right sidebar).