Fork me on GitHub

K2 的Workspace 遭遇400 RequestLength 错误修复

每当遇到http错误代码为400,代表客户端发起的请求不符合服务器对请求的某些限制,或者请求本身存在一定的错误。

使用Fiddler2 查看请求发现请求的长度超过了MaxRequestBytes的默认长度16384. 

在IIS的错误日志里头也看到了

C:\WINDOWS\system32\LogFiles\HTTPERR\ httperr1.log 的错误

2012-12-17 05:33:00 10.13.64.91 12433 10.14.12.25 80 HTTP/1.1 GET /Workspace/Navigation/Navigation.aspx 400 - RequestLength -

2012-12-17 05:33:16 10.13.64.91 12433 10.14.12.25 80 - - - - - Timer_MinBytesPerSecond -

2012-12-17 05:36:36 10.13.64.91 12516 10.14.12.25 80 HTTP/1.1 GET /Workspace/Navigation/Navigation.aspx 400 - RequestLength -

2012-12-17 05:36:39 10.13.64.91 12518 10.14.12.25 80 HTTP/1.1 GET /Workspace/Navigation/Navigation.aspx 400 - RequestLength –

解决的方法是更改注册表

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\http\Parameters

MaxFieldLength = 65534 和 MaxRequestBytes =65534

参数的意义参考 用于 IIS 的 Http.sys 注册表设置.

1、  通过以下命令重起系统http服务 (需要管理员权限)
Net stop http

Net start http

2、通过以下命令重起iis服务
IISRESET 

参考文章:

Http 400错误重现实验及解决办法

Fixing 400 RequestLength Issue in SharePoint and IIS

posted @ 2012-12-17 14:26  张善友  阅读(1057)  评论(0编辑  收藏  举报