当上传一个超过30M的文件时,服务器会重定向至404.13页面,报错如下:

HTTP Error 404.13 - Not Found

The request filtering module is configured to deny a request that exceeds the request content length.

此请求的查询字符串的长度超过配置的 maxQueryStringLength 值

一、全局配置 C:\Windows\System32\inetsrv\config目录下的applicationhost.config  (iis配置文件)

  1. 配置节system.webServer/security/requestFiltering/ 下增加以下配置

    maxAllowedContentLength的单位为Bytes

<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="40000000" />
</requestFiltering>
<security>
<system.webServer>

二、局部配置 

  1.  applicationhost.config允许配置覆盖, "Deny" to "Allow" like so: (IIS7.5 默认Allow)

  

<sectionGroup name="security">
<section name="access" overrideModeDefault="Deny" />
<section name="applicationDependencies" overrideModeDefault="Deny" />
<sectionGroup name="authentication">
<section name="anonymousAuthentication" overrideModeDefault="Deny" />
<section name="basicAuthentication" overrideModeDefault="Deny" />
<section name="clientCertificateMappingAuthentication" overrideModeDefault="Deny" />
<section name="digestAuthentication" overrideModeDefault="Deny" />
<section name="iisClientCertificateMappingAuthentication" overrideModeDefault="Deny" />
<section name="windowsAuthentication" overrideModeDefault="Deny" />
</sectionGroup>
<section name="authorization" overrideModeDefault="Allow" />
<section name="ipSecurity" overrideModeDefault="Deny" />
<section name="isapiCgiRestriction" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
<section name="requestFiltering" overrideModeDefault="Allow" />
</sectionGroup>

  2. Web。config文件 system.webServer/security/节下增加以下配置

 <requestFiltering>
<requestLimits maxUrl="409600" maxQueryString="204800" maxAllowedContentLength="2097152" /> <!--单位字节Byte(2048000)-->
<fileExtensions> </fileExtensions>
</requestFiltering>

  Web,config

<configuration>
<system.web>
    <httpRuntime maxRequestLength="999999999" maxQueryStringLength="2097151" />
  </system.web>
</configuration>

【参考文献】https://blog.csdn.net/yw1688/article/details/49070633

IIS 配置详解 请求长度限制调整的更多相关文章

  1. Tomcat安装及配置详解

    Tomcat安装及配置详解   一,Tomcat简介 Tomcat 服务器是一个免费的开放源代码的Web 应用服务器,Tomcat是Apache 软件基金会(Apache Software Found ...

  2. Tomcat 优化方案 和 配置详解(转)

    转自 Tomcat 优化方案 和 配置详解 http://201605130349.iteye.com/blog/2298985 Server.xml配置文件用于对整个容器进行相关的配置. <S ...

  3. Tomcat记录-tomcat常用配置详解和优化方法(转载)

    常用配置详解 1 目录结构 /bin:脚本文件目录. /common/lib:存放所有web项目都可以访问的公共jar包(使用Common类加载器加载). /conf:存放配置文件,最重要的是serv ...

  4. tomcat常用配置详解和优化方法

    tomcat常用配置详解和优化方法 参考: http://blog.csdn.net/zj52hm/article/details/51980194 http://blog.csdn.net/wuli ...

  5. Log4j配置详解(转)

    一.Log4j简介 Log4j有三个主要的组件:Loggers(记录器),Appenders (输出源)和Layouts(布局).这里可简单理解为日志类别,日志要输出的地方和日志以何种形式输出.综合使 ...

  6. log4j.properties配置详解

    1.Loggers Loggers组件在此系统中被分为五个级别:DEBUG.INFO.WARN.ERROR和FATAL.这五个级别是有顺序的,DEBUG < INFO < WARN < ...

  7. Log4J日志配置详解

    一.Log4j简介 Log4j有三个主要的组件:Loggers(记录器),Appenders (输出源)和Layouts(布局).这里可简单理解为日志类别,日志要输出的地方和日志以何种形式输出.综合使 ...

  8. redis配置详解

    ##redis配置详解 # Redis configuration file example. # # Note that in order to read the configuration fil ...

  9. Log.properties配置详解

    一.Log4j简介 Log4j有三个主要的组件:Loggers(记录器),Appenders (输出源)和Layouts(布局).这里可简单理解为日志类别,日志要输出的地方和日志以何种形式输出.综合使 ...

随机推荐

  1. docker自动重启容器

    docker run --restart=always  -d --name myunbuntu ubuntu /bin/bash -c "l am a docker"   //无 ...

  2. Leetcode 记录(101~200)

    Now, I want to just use English to explain the problem, it's about two month before the interview, s ...

  3. eclipse 导入android 项目重名解决方法

    在进行andoid 开发时会用到许多的开源框架,但有时候发现几天框架的项目名字都是 library. 解决方法: 1.如果项目中没有 .project 文件,直接修改项目文件夹的名字即可,注意在你引用 ...

  4. Yii Cache 缓存的使用

    我的缓存组件配置在config\main.php文件,配置如下: 'components' => [ 'cache' => [ 'class' => 'yii\caching\Fil ...

  5. 【C语言程序】让用户输入十个数,用冒泡排序法从小到大排序

    #include <stdio.h> #define N 10 void swap(int*a,int*b); int main(int argc, char *argv[]) {  in ...

  6. oracle 存储过程调用方式

    Oracle存储过程包含三部分:过程声明,执行过程部分,存储过程异常. Oracle存储过程可以有无参数存储过程和带参数存储过程. 一.无参程序过程语法 1 create or replace pro ...

  7. css冲刺

    CSS知识点及面试题 1.一般与文本相关的属性都可以继承text-/font-/line- 2.background属性1)background-repeat:repeat/repeat-x/repe ...

  8. JAVA自学笔记18

    JAVA自学笔记18 1.Map接口: 1)功能: 2) Map<String,String>m=new HashMap<String,String>(); //添加元素,元素 ...

  9. [Nuget]使用Nuget管理工具包

    摘要 这里演示如何使用Nuget对类库进行打包,并将类库上传到nuget上面. 步骤 1.在nuget官网注册账号,并登陆. https://www.nuget.org 2.下载Nuget.exe,并 ...

  10. JAVA中调用LevelDB用于Linux和Window环境下快速存储KV结构

    一.简介 JAVA中调用LevelDB用于Linux和Window环境下快速存储KV结构 二.依赖 <!-- https://mvnrepository.com/artifact/org.fus ...