Upload file limit causes 413-request Entity Too Large

Source: Internet
Author: User
Tags nginx server

When using Nginx, when uploading images asynchronously to the server, found to throw "error" errors, carefully found that the throw error content is: 413-request Entity Too Large, see the Tomcat run log when the background did not receive a file upload request, Finally found that Nginx limited the size of the file upload, directly intercepted the request. This error is due to nginx default upload file size configuration client_max_body_size only 2MB.

Workaround:

1, spring MVC upload files when the profile upload size (usually must be set, although I am not the reason)

<!--file Upload--<bean id= "Multipartresolver" class= " Org.springframework.web.multipart.commons.CommonsMultipartResolver "> <property name=" defaultencoding "value = "UTF-8" ></property> <property name= "maxuploadsize" value= "99999999999" ></property> < Property Name= "Resolvelazily" value= "true" ></property> </bean>

2, modify the Nginx server reverse proxy configuration file

Last reboot Nginx:./nginx-s Reload

Reference article: 51992986

Upload file limit causes 413-request Entity Too Large

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.