reg add HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesHTTPParameters /v MaxRequestBytes /t REG_DWORD /d 32768
(需要在命令行运行 net stop http & net start http & iisreset 使设置生效)
5、针对负载均衡场景的设置
在Url Rewrite Module中增加如下的规则:
<rewrite>
<allowedServerVariables>
<add name="REMOTE_ADDR" />
</allowedServerVariables>
<globalRules>
<rule name="HTTP_X_Forwarded_For-to-REMOTE_ADDR" enabled="true">
<match url=".*" />
<serverVariables>
<set name="REMOTE_ADDR" value="{HTTP_X_Forwarded_For}" />
</serverVariables>
<action type="None" />
<conditions>
<add input="{HTTP_X_Forwarded_For}" pattern="^$" negate="true" />
</conditions>
</rule>
</globalRules>
</rewrite>
相关博文:迁入阿里云后遇到的Request.UserHostAddress记录IP地址问题
注意事项:添加该URL重写规则会造成IIS内核模式缓存不工作,详见微软的坑:Url重写竟然会引起IIS内核模式缓存不工作。
6、 设置Cache-Control为public
在web.config中添加如下配置:
<configuration> <system.webServer> <staticContent> <clientCache cacheControlCustom="public" /> </staticContent> </system.webServer> </configuration>
7、ASP.NET线程设置
在machine.config的<processModel>中添加如下设置:
<processModel enable="true" maxWorkerThreads="100" maxIoThreads="100" minWorkerThreads="50" minIoThreads="50"/>









