IIS 8 - 自定义400错误(错误请求) [英] IIS 8 - customize error 400 (Bad Request)
问题描述
该请求被截获的IIS,它从不打我的申请。
我想,我的错误处理来管理这个错误,而不是IIS。这可能吗?
我试过很多东西,其中包括:
-
在我的web.config:
< httpErrors errorMode =DetailedLocalOnlyexistingResponse =直通>< / httpErrors>
-
这没有任何帮助
-
另外这款配置:
< httpErrors errorMode =DetailedLocalOnlyexistingResponse =直通>
<清除状态code =400/>
<错误状态code =400路径=http://www.google.comresponseMode =重定向/>
< / httpErrors>
块引用><醇开始=4>从 MSDN ( IIS 7,没事就IIS 8文档):
您不能自定义以下HTTP错误信息:400,403.9,
411,414,500,500.11,500.14,500.15,501,503,和505。
块引用>在这里我们可以复制错误:
http://stackoverflow.com/ %%%(你应该复制整个环节,与无效字符在内)。
解决方案看来你的运气了以此为以下线程已经显示:<一href=\"http://serverfault.com/questions/257680/properly-handle-iis-request-with-percent-sign-in-url\">http://serverfault.com/questions/257680/properly-handle-iis-request-with-percent-sign-in-url
一个可行的办法是在负载平衡器来处理这个错误code(这当然不会是IIS为基础)。
The request is intercepted by the IIS, and it never hits my application.
I want that my Error Handling to manage this error, not IIS. Is this possible?
I've tried many things, including these:
In my Web.config:
<httpErrors errorMode="DetailedLocalOnly" existingResponse="PassThrough"></httpErrors>
This is not helping either.
Also this configuration:
<httpErrors errorMode="DetailedLocalOnly" existingResponse="PassThrough"> <remove statusCode="400"/> <error statusCode="400" path="http://www.google.com" responseMode="Redirect"/> </httpErrors>
- From the MSDN (IIS 7, nothing on IIS 8 documentation):
You cannot customize the following HTTP error messages: 400, 403.9, 411, 414, 500, 500.11, 500.14, 500.15, 501, 503, and 505.
Here we can replicate the error:
http://stackoverflow.com/ %%% (you should copy the entire link, with the invalid characters included).
解决方案It seems that you are out of luck with this as the following thread already shows: http://serverfault.com/questions/257680/properly-handle-iis-request-with-percent-sign-in-url
One possible solution is to handle this error code at your load balancer (which of course will not be IIS based).
这篇关于IIS 8 - 自定义400错误(错误请求)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!