我如何禁止通过代理 - ASP网络发出的请求 [英] How do I disallow requests made over proxy - ASP net
本文介绍了我如何禁止通过代理 - ASP网络发出的请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望我的ASP.net编写的WEB应用程序拒绝进入通过代理连接的客户端。因此,我希望停止自动BOTS。
<?xml version =1.0encoding =utf-8?>
<! -
有关如何配置ASP.NET应用程序的更多信息,请访问
http://go.microsoft.com/fwlink/?LinkId=169433
- >
<! - Web.config文件 - >
< configuration>
< system.web>
< authentication mode =Forms>
<! - < forms loginUrl =default.aspxname =idprotection =All/> - >
< / authentication>
< httpRuntime targetFramework =4.5/>
< compilation debug =true/>
< /system.web>
< appSettings>
< add key =ValidationSettings:UnobtrusiveValidationModevalue =None/>
< / appSettings>
< runtime>
< assemblyBinding xmlns =urn:schemas-microsoft-com:asm.v1>
< dependentAssembly>
< assemblyIdentity name =System.Web.HelperspublicKeyToken =31bf3856ad364e35/>
< bindingRedirect oldVersion =1.0.0.0-3.0.0.0newVersion =3.0.0.0/>
< / dependentAssembly>
< dependentAssembly>
< assemblyIdentity name =System.Web.WebPagespublicKeyToken =31bf3856ad364e35/>
< bindingRedirect oldVersion =1.0.0.0-3.0.0.0newVersion =3.0.0.0/>
< / dependentAssembly>
< dependentAssembly>
< assemblyIdentity name =System.Web.MvcpublicKeyToken =31bf3856ad364e35/>
< bindingRedirect oldVersion =0.0.0.0-5.2.0.0newVersion =5.2.0.0/>
< / dependentAssembly>
< / assemblyBinding>
< / runtime>
< system.webServer>
< rewrite>
< / rewrite>
< /system.webServer>
< / configuration>
我的尝试:
我用谷歌搜索但未找到正确的样本。
解决方案
如果您使用的是IIS 8,可以尝试以下设置
IIS 8.0添加了enableProxyMode属性使您能够阻止来自通过代理连接的客户端的请求。添加了denyAction属性以指定IIS发送回客户端的默认拒绝模式响应。
I want my ASP.net written WEB application to deny entrance to those clients that connect over a Proxy. I want thus to stop automated BOTS.
<?xml version="1.0" encoding="utf-8"?> <!-- For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?LinkId=169433 --> <!-- Web.config file --> <configuration> <system.web> <authentication mode="Forms"> <!-- <forms loginUrl="default.aspx" name="id" protection="All" />--> </authentication> <httpRuntime targetFramework="4.5" /> <compilation debug="true" /> </system.web> <appSettings> <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" /> </appSettings> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> <system.webServer> <rewrite> </rewrite> </system.webServer> </configuration>
What I have tried:
I have googled but not found what the correct sample.
解决方案
Hi ,
If you are using IIS 8 you can try below setting
IIS 8.0 The enableProxyMode attribute was added to enable you to block requests from a client that connects through a proxy. The denyAction attribute was added to specify the default deny mode response that IIS sends back to clients.
这篇关于我如何禁止通过代理 - ASP网络发出的请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文