当上传一个超过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. POJ 水题(刷题)进阶

    转载请注明出处:優YoU http://blog.csdn.net/lyy289065406/article/details/6642573 部分解题报告添加新内容,除了原有的"大致题意&q ...

  2. 3ds max学习笔记(六)-- 基本操作(建模前奏)

    1.界面设置 在3ds Max的版本的界面中,默认是较深.若需要切换至较亮的界面,步骤: 执行“自定义”菜单,选择“加载自定义用户界面方案”从弹出的界面中选择样式文件,单击“打开”即可: 注:“amg ...

  3. Vue(三)常用指令

    (1) v-model 双向数据绑定,一般用于表单元素 <script> window.onload=function(){ new Vue({ // el:'.itany', el:'d ...

  4. CiscoIOUKeygen

    python CiscoIOUKeygen.py | grep -A 1 ‘license’ > iourc

  5. MSSQL 调用C#程序集 实现C#字符串到字符的转化

    10多年前用过MSSQL 调用C#程序集来实现数据的加密和解密,也搞过通过字符偏移实现简单的加密和解密.这次就总结一下吧: C#如下: public class CLRFunctions { /// ...

  6. 将 Smart 构件发布到 Maven 中央仓库

    https://my.oschina.net/huangyong/blog/226738

  7. c++中POD类型和non-POD类型

    对于一个array来说: For POD-types, a shallow copy or memcpy of the whole array is good enough, while for no ...

  8. Grafana数据可视化

    1.1 Grafana简介 1.1.1 Grafana是什么? 一个类似Kibana的东西,也是对后端的数据进行实时展示,那么Grafana和Kibana有什么区别?在我看来区别不大,不过在大家的日常 ...

  9. [Python设计模式] 第24章 加薪审批——职责链模式

    github地址:https://github.com/cheesezh/python_design_patterns 题目 用程序模拟以下情景 员工向经理发起加薪申请,经理无权决定,需要向总监汇报, ...

  10. protobuf 动态创建

    https://www.ibm.com/developerworks/cn/linux/l-cn-gpb/index.html https://originlee.com/2015/03/14/ana ...