This article describes how to solve the 413 Request Entity Too Large problem on nginx, Apache, and IIS servers.
I. nginx Server
The reason for this problem is that the request entity is too long. Generally, when a Post request is sent, the Body contains too much Post data,
The uploaded files are too large and contain a large amount of POST data.
Solution
Add the client_max_body_size setting in nginx. conf. The default value is 1 MB, which can be increased to 8 MB to increase the file size limit. Of course, you can set a bigger point.
# Modify the following configurations in the http, server, or location segments:
# Set client body size to 8 M #
Client_max_body_size 8 M;
Ii. Apache server
Modify the LimitRequestBody configuration in the Apache configuration file. If it is a virtual host, contact the space provider for help.
Procedure:
When uploading large software in the apache environment, the 413 error may occur sometimes. The cause of this error is caused by improper configuration of apache, find the configuration file directory of apache, that is, the conf directory. A directory parallel to this directory is called conf. d. Open the conf file. d. There is a php in it. conf
The directory content is as follows:
#
# PHP is an HTML-embedded scripting language which attempts to make it
# Easy for developers to write dynamically generated webpages.
#
LoadModule php4_module modules/libphp4.so
#
# Cause the PHP interpreter handle files with a. php extension.
#
SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 6550000
#
# Add index. php to the list of files that will be served as directory
# Indexes.
# Www.jbxue.com
DirectoryIndex index. php
The error occurs in the LimitRequestBody configuration. You can change the value to a value greater than the size of your software.
If you do not have this configuration file
SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 6550000
Write it to the apache configuration file.
Iii. IIS Server (Windows Server 2003 system IIS6)
Stop the IIS Admin Service first, and then
Find metabase. xml under windows \ system32 \ inesrv \, open it, find ASPMaxRequestEntityAllowed and change it to the desired value, and then restart the IIS Admin Service.
1. web service extensions allow active server pages and server-side documents
2. Modify the attribute home directory of each site-configuration-Option-enable parent path
3. Make it possible to upload a large document (modify it to the desired size, in bytes)
C: \ WINDOWS \ system32 \ inetsrv \ MetaBase. xml
! Windows 592nd for Enterprise Edition is on line 1
Default pre-set value: AspMaxRequestEntityAllowed = "204800", that is, 200 K
Add it to two zeros, that is, change it to. Now the maximum size is 20 mb.
AspMaxRequestEntityAllowed = "20480000"