org.apache.coyote.http11.HeadersTooLargeException: An attempt was made to write more data to the response headers than there was room available in the buffer. Increase maxHttpHeaderSize on the connector or write less data into the response headers.


org.apache.coyote.http11。HeadersTooLargeException:尝试向响应头写入的数据比缓冲区中可用的空间要多。在连接器上增加maxHttpHeaderSize,或者将更少的数据写入响应头。


server.xml 原来没有配置 maxHttpHeaderSize,默认值只有 4096 个字节(4k)


解决方案: 修改TOMCATE中的conf文件夹下的server.xml文件,具体修改如下: 


<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" maxHttpHeaderSize="500000"/>


重启下 tomcat,可以了。


那 maxHttpHeaderSize 应该设置多大才是最优的呢?貌似也没太大影响,够用就好,网上说一般设置 8K。具体多少,可以抓下请求头,看看是否合适。


友情链接
KaDraw流程图
API参考文档
OK工具箱
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:ixiaoyang8@qq.com
QQ群:637538335
关注微信