【问题标题】:HTTP Error 404.13 - Not FoundHTTP 错误 404.13 - 未找到
【发布时间】:2016-04-07 13:05:40
【问题描述】:

尝试调试我的应用程序时出现 seuinte 错误。

HTTP 错误 404.13 - 未找到

请求过滤模块被配置为拒绝一个请求 超出请求内容大小。

检查configuration/system.webServer/security/requestFiltering/requestLimits@maxAllowedContentLength setting in applicationhost.config 或 web.config 文件。

我的 web.config

<system.webServer>
    <modules>
      <remove name="FormsAuthentication" />
      <remove name="ApplicationInsightsWebTracking" />
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />
    </modules>
    <validation validateIntegratedModeConfiguration="false" />
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="31457280"/>
      </requestFiltering>
    </security>   </system.webServer>

更多信息:

这和一个安全功能。 NOT Change a Less than 更改的范围是完全理解的。快速 您可以配置 IIS 服务器拒绝其内容大于指定的哼声值的请求。如果请求内容大于设置 * Size 则返回 ESSE 错误。需要增加 * 内容大小,修改配置configuration/system.webServer/security/requestFiltering/requestLimits@maxAllowedContentLength .

【问题讨论】:

    标签: c#


    【解决方案1】:

    您需要调整应用程序中的 maximumRequestLength 属性来处理如此大的文件。

    重要的是要知道 maxAllowedContentLength 以字节为单位,maximumRequestLength 在设置这些值时以千字节为单位,因此您需要相应地调整它们:

    <configuration>
        <system.web>
            <!-- This will handle requests up to 1024MB (1GB) -->
            <httpRuntime maxRequestLength="1048576" timeout="3600" />
        </system.web>
    </configuration>
    
    <!-- IIS Specific Targeting (noted by the system.webServer section) -->
    <system.webServer>
       <security>
          <requestFiltering>
             <!-- This will handle requests up to 1024MB (1GB) -->
             <requestLimits maxAllowedContentLength="1048576000" />
          </requestFiltering>
       </security>
     </system.webServer>
    

    【讨论】:

    • 没有超时只有executionTimeout
    【解决方案2】:

    你有吗

    <configuration>
        <system.web>
            <httpRuntime maxRequestLength="1048576" />
        </system.web>
    </configuration>
    

    在你的配置中呢?我认为您还需要将&lt;httpRuntime maxRequestLength="1048576" /&gt; 添加到 yoru 配置文件中。

    我从这里得到这个 - Maximum request length exceeded

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-12
      • 2016-12-03
      • 1970-01-01
      • 2017-07-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多