简体   繁体   English

500内部服务器错误IIS7编码的URL

[英]500 Internal Server Error IIS7 Encoded url

Im using N2Cms and am looking in to some issues i have with it. 我正在使用N2Cms,我正在寻找我的一些问题。 It has a navigation panel on the left hand side that loads via ajax as you expand the tree. 它在左侧有一个导航面板,在您展开树时通过ajax加载。

The code that gets the childeren of the node calls an ashx file with some parameters. 获取节点的childeren的代码调用带有一些参数的ashx文件。 One parameter is for a path and contains slashes in it. 一个参数用于路径并包含斜杠。 For this reason it has been encoded. 出于这个原因,它已被编码。

.../cms/Content/Navigation/LoadTree.ashx?target=preview&selected=%252fhome%252fhelp-and-advice%252f

I have had no issues with this on my development server (running iis 7.5) but when deployed to our test server (iis7) the navigation fails to work. 我在我的开发服务器(运行iis 7.5)上没有遇到任何问题,但是当部署到我们的测试服务器(iis7)时,导航无法正常工作。

Investigating this has shown that the above url gives a 500 error. 调查这表明上面的url给出了500错误。

If i decode the url to 如果我解码网址

.../cms/Content/Navigation/LoadTree.ashx?target=preview&selected=/home/help-and-advice/

it works with no problems. 它没有任何问题。

Unfortunately i cannot change the code that generates this as its a part of the n2cms source code and i am assuming it has been encoded for a good reason. 不幸的是,我无法将生成此代码的代码更改为n2cms源代码的一部分,我假设它已被编码有充分理由。

Does anyone know anything i can do either in my web.config to allow encoded parameters or something i can change on the iis server? 有没有人知道我可以在我的web.config中做什么来允许编码参数或我可以在iis服务器上更改的东西?

EDIT: So this link seems to suggest that its doing this on purpose as a security mesure. 编辑:所以这个链接似乎暗示它作为一个安全问题故意这样做。 http://msdn.microsoft.com/en-us/library/ee656542.aspx http://msdn.microsoft.com/en-us/library/ee656542.aspx

The suggested solution is to upgrade to .net 4.0 and add the following to the web.config 建议的解决方案是升级到.net 4.0并将以下内容添加到web.config中

<configuration>
 <uri>
   <schemeSettings>
    <add name="http" genericUriParserOptions="DontUnescapePathDotsAndSlashes"/>
   </schemeSettings>
 </uri>
</configuration>

Unfortunately this seems to have no effect. 不幸的是,这似乎没有任何效果。

Any Ideas why this doesnt work? 任何想法为什么这不起作用?

This could be the URLScan utility. 这可能是URLScan实用程序。 URL Scan blocks URL's based on the rules in it's config file. URL扫描根据其配置文件中的规则阻止URL。 It also has it's own log file, so you can tell for sure by looking at the URLScan log. 它还有自己的日志文件,因此您可以通过查看URLScan日志来确定。

Do a google search for URLSCan default location. 谷歌搜索URLSCan默认位置。

It seems your url goes through 2 html encode. 看来你的网址经历了2个html编码。 Is there some url rewriting module active on your IIS7 server ? 您的IIS7服务器上是否有一些URL重写模块处于活动状态?

OK, im getting somewhere with this. 好的,我正在这个地方。

When trying to find the error in the IIS logs and failing, then looking through many posts about failed tracing request and still not getting any errors in iis, i figured that the request was just not getting to IIS. 当试图在IIS日志中找到错误并失败时,然后查看有关失败的跟踪请求的许多帖子并且仍然没有在iis中出现任何错误,我认为该请求只是没有进入IIS。

Looking back at the server error, there was a clue there too. 回顾一下服务器错误,也有一个线索。
500 Internal Server Error. 500内部服务器错误。 The request was rejected by the HTTP filter. 该请求被HTTP筛选器拒绝。

It is the firewall!! 这是防火墙!! We have disabled the HTTP Filter and now it works :) 我们已禁用HTTP过滤器,现在它可以工作:)

I now need to investigate what this HTTP Filter was supposed to be protecting us against and are we secure now we have switched it off. 我现在需要调查这个HTTP过滤器应该保护我们的内容,并且我们现在已经关闭它了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM