Nginx and tomcat:413 request Entity Too Large (requested entity too large)

Source: Internet
Author: User

Recent development encountered a failure to upload, look at the log actually shows the POST request entity too large.

Then check the data and modify the configuration of Proxy server Nginx and server tomcat

**1.**nginx

As a reverse proxy server, Nginx received the client request first, there must be some restrictions. All the nginx.conf files under the Conf folder are modified in

server{
    client_max_body_size     50m;//Modify to the value you want to set
}

and then reboot it OK.

2.Tomcat

Immediately after modifying the server configuration, the Server.xml in Tomcat's Conf folder

<connector port= "8080" protocol= "http/1.1   
    " connectiontimeout= "redirectport=" uriencoding= "UTF-8"  
    maxthreads= "3000"  
    compression= "on" compressablemimetype= "Text/html,text/xml   
    " Maxpostsize= "10240"/>  

//Where the parameter maxpostsize= "10240" is to limit the size of the POST request parameter, change the value to 0 to represent no limit.

Note:
This situation is OK in our development environment, but after the line to Aliyun, Springmvc all the POST request parameters can not receive the problem.

After the removal of good, it is recommended to set the size you want, restart Tomcatok.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.