Nginx and Jetty, Tomcat's limit setting for Http body size

Our most common Nginx and Jetty are used as the access layer and web container. These two open source software will limit the size of the body. We can use the following methods to modify this limit to support our own business.

 

Jetty

 

The default value of Jetty is 200k. We can modify this default setting in the configuration, modify JETTY_HOME/etc/jetty.xml, and reassign maxFormContentSize, -1 means no limit, and a positive value means the maximum bytes allowed:

 

<Call class="java.lang.System" name="setProperty">  
         <Arg>org.mortbay.jetty.Request.maxFormContentSize</Arg>  
         <Arg>-1</Arg>  
</Call>

 

 

Nginx

 

Modify nginx.conf in the nginx directory, and set client_max_body_size in the http module, 0 means not set, you can use M as the unit:

 

http {
    #......
    client_max_body_size 300M;
    #......
}

 

Tomcat

 

The default limit is 2097152bytes (2MB). 
The method to modify the default limit value is as follows:
modify the tomcat configuration file $TOMCAT_HOME$/conf/server.xml, 
find the <Connector> node inside, add the "maxPostSize" attribute to the node, and set the The property value is set to the maximum value you want (unit: byte, 0 means no limit).  

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326526367&siteId=291194637