如何让 IIS7 停止服务文件夹? [英] How to make IIS7 stop serving a folder?

查看:13
本文介绍了如何让 IIS7 停止服务文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道默认情况下 IIS 不会将 App_Data 或 bin 文件夹内容提供给公众.
如何再设置一个文件夹不公开?

I know that by defualt IIS won't server App_Data or bin folders content to the public.
How to set one more folder to don't server to public?

推荐答案

正确的做法是使用这个:

The proper way to do that is using this:

<configuration>
   <system.webServer>
       <security>
          <requestFiltering>
               <hiddenSegments>
                   <add segment="My_Directory" />
               </hiddenSegments>
           </requestFiltering>
       </security>
   </system.webServer>
</configuration>

这使您仍然可以从 IUSR 帐户访问位于那里的文件,但会阻止直接填写对那里的文件的实际请求.

This allows you to still access files located there from the IUSR account, but prevents actual requests for files there from being filled directly.

请注意,这将阻止该目录和任何子目录中的文件,无论该目录出现在何处 - 即使它本身是其他东西的子目录.

Note that this will block files in that directory, and any subdirectories, no matter where that directory occurs - even if it, itself, is a sub-directory of something else.

这篇关于如何让 IIS7 停止服务文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆