tomcat报错Error parsing HTTP request header处理

项目部署到linux服务器后,启动项目报以下错误

May 18, 2017 10:01:52 AM org.apache.coyote.http11.AbstractHttp11Processor process
INFO: Error parsing HTTP request header
Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
java.lang.IllegalArgumentException: Invalid character found in method name. HTTP method names must be tokens
at org.apache.coyote.http11.InternalInputBuffer.parseRequestLine(InternalInputBuffer.java:135)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:996)

网上查了下,说是因为httpHeaderSize大小不够导致的,要修改tomcat的配置,新加一个字段maxHttpHeaderSize。配置后为:


    <Connector URIEncoding="UTF-8" acceptCount="100" compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain" 
    compression="on" compressionMinSize="10240" connectionTimeout="20000" disableUploadTimeout="true" 
    enableLookups="false" maxHttpHeaderSize="81920" maxSpareThreads="75" maxThreads="150" 
    minSpareThreads="25" noCompressionUserAgents="gozilla, traviata" port="1080" 
    protocol="HTTP/1.1" redirectPort="1443" />

测试后发现问题解决。

你可能感兴趣的:(问题记录)