Windows Azure网站maxQueryStringLength [英] Windows Azure WebSites maxQueryStringLength

查看:99
本文介绍了Windows Azure网站maxQueryStringLength的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将jquery dataTables与Azure网站上的一些其他功能一起使用。它会生成一个较大的查询字符串(测试中为2121个字符)。这会在Azure网站上返回错误代码(您要查找的资源已被删除,名称已更改或暂时不可用。)。

I'm trying to use jquery dataTables with a few extras on Azure Websites. It generates a sizeable query string (2121 characters in testing). This returns a bad code on Azure websites (The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.).

要使其正常工作在本地,我使用以下命令编辑了web.config:

To get it working locally I edited the web.config with this:

<httpRuntime maxQueryStringLength="4000" maxUrlLength="4000"/>

(我相信只需要maxQueryStringLength)。

(I believe only the maxQueryStringLength is really needed).

无论如何,在本地和其他服务器上一切正常,但是在WA网站上,我无法正常运行。有任何想法吗?

Anyway, all is fine locally and on another server but on WA Web Sites I can't get it working. Any ideas?

推荐答案

尝试自定义 IIS请求过滤参数
我怀疑您正在使用 Cassini (Visual Studio开发服务器)在本地进行开发。

Try customizing IIS Request Filtering parameters. I suspect you're using Cassini (Visual Studio development server) to develop locally.

与查询字符串和/相关的限制或URL最大长度在Azure网站(或任何IIS环境)上分为两个级别:

Limitations related to Query String and/or URL max lengths occur at two levels on Azure Websites (or any IIS environments) :


  • ASP.NET运行时:使用 httpRuntime 节点及其关联属性

  • IIS请求过滤可以解除这些限制。 >模块:即使在ASP.NET Runtime处理请求之前,IIS也会应用自己的有关URL和查询字符串长度的过滤规则。默认情况下,查询字符串的最大允许长度为2048(请参见此处)。您应该在 Web.config requestLimits 子节点下设置适当的值,例如:

  • ASP.NET Runtime : These limits are lifted using the httpRuntime node and its associated attributes
  • IIS Requests Filtering module : IIS also applies its own filtering rules regarding URL and Query String length, even before the request is processed by the ASP.NET Runtime. By default, the maximum allowed length for a query string is 2048 (see here). You should set the appropriate values in your Web.config, under the requestLimits subnodes, eg :

<system.webServer>
  <security>
    <requestFiltering>
      <requestLimits maxQueryString="4096"/>
    </requestFiltering>
  </security>
</system.webServer>


另请参见此问题

这篇关于Windows Azure网站maxQueryStringLength的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆