[英]File Security (IP address access restrictions) in IIS7
I have a web service that contains 2 asmx files (public.asmx and private.asmx). 我有一个包含2个asmx文件的Web服务(public.asmx和private.asmx)。 On IIS6 I could go to the properties of private.asmx then, from the 'File Security' tab, deny all computers access except the IP address for localhost. 在IIS6上,我可以转到private.asmx的属性,然后从“文件安全性”选项卡中拒绝除localhost的IP地址之外的所有计算机访问。
In IIS7 I only seem to be able to do this for an entire folder. 在IIS7中,我似乎只能为整个文件夹执行此操作。 What am I missing? 我错过了什么?
Funny - I found this question because I have the same problem, but I think the solution is as follows: 搞笑 - 我发现这个问题因为我有同样的问题,但我认为解决方案如下:
I am learning the ropes of IIS7 myself, but I hope this answers your question. 我自己正在学习IIS7的绳索,但我希望这能回答你的问题。
Found this question via Google and was looking for how to do it via the .config file but could not find that answer here. 通过谷歌找到了这个问题,并且正在寻找如何通过.config文件来完成这个问题但是在这里找不到答案。 I've since tracked down the info: 我已经跟踪了这些信息:
The ipSecurity
element is used by the web.config in IIS7 to restrict access by IP Address. IIS7中的web.config使用ipSecurity
元素来限制IP地址的访问。 You can use it like this: 你可以像这样使用它:
<configuration>
<location path="private.asmx">
<system.webServer>
<security>
<ipSecurity>
<add ipAddress="192.168.100.1" />
<add ipAddress="169.254.0.0" subnetMask="255.255.0.0" />
</ipSecurity>
</security>
</system.webServer>
</location>
</configuration>
Update: Note that the role has to be added for this security to be enabled. 更新:请注意,必须添加角色才能启用此安全性。 See the ipSecurity
article linked above. 请参阅上面链接的ipSecurity
文章。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.