Tomcat设置HTTP首部长度最大值maxHttpHeaderSize
发布时间:2018-08-23 14:53,
浏览次数:14172
, 标签:
Tomcat
maxHttpHeaderSize
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文件,具体修改如下:
重启下 tomcat,可以了。
那 maxHttpHeaderSize 应该设置多大才是最优的呢?貌似也没太大影响,够用就好,网上说一般设置 8K。具体多少,可以抓下请求头,看看是否合适。