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

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

问题描述

我知道通过defualt 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?

推荐答案

正确的方法是使用它:

<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天全站免登陆