springboot project error Request header is too large of solutions

Reprinted Source: https://blog.csdn.net/aa292016616/article/details/80599149

This is due to the tomcat limits the length of the header, if the amount of data you requested exceeds the default length will be thrown out of bounds,

There are two solutions (depending on the project may be):

    1.springboot is built of tomcat tomcat can not modify the contents of the file, xxxx.yml in springboot plus

server:
  #tomcat:
    #max-http-post-size: -1
  max-http-header-size: 4048576


If the configuration file can then type xxxx.propertis

server.max-http-header-size = 4048576
 
If the message is to limit the length of the post plus the size of their own definition of
max-HTTP-post-size
2. Modify the server.xml tomcat

    Here Plus

 maxPostSize="8000000"
  <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" maxPostSize="8000000"/>

Published 23 original articles · won praise 7 · views 20000 +

Guess you like

Origin blog.csdn.net/ghd602338792/article/details/89183822