我刚配置我的Web应用程序使用IIS而不是ASP.NET dev服务器,我得到一些奇怪的行为。
http://localhost:49584/Templates/UI/Img/featured_area_bg.gif
http://localhost/NopCommerceStore/Templates/UI/Img/featured_area_bg.gif
当我访问第一个网址时,我的图像就像它应该的那样。
当我访问第二个时,我被重定向到登录页面。 web.config中没有配置将该路径的任何部分限制为角色或用户名。即使我在重定向后登录,它仍然无法显示。
使用Process Monitor,我能够看到IIS遇到的问题。结果如下所示。
路径:F:\ Development \ Freelance \ AWS \ Store \ NopCommerceStore \ Templates \ UI \ Img \ active_item.gif
期望的访问:通用读取
处置:打开
选项:顺序访问,无缓冲
属性:RE
ShareMode:读,写,删除
AllocationSize:不适用
冒充:NT AUTHORITY \ IUSR
答案 0 :(得分:1)
web.config中的身份验证和授权设置是什么?
试一下。
<authorization>
<allow users="*"/>
<deny users="?"/>
</authorization>