如何避免请求实体太大413错误 [英] How to avoid Request Entity Too Large 413 error
问题描述
如何避免这种413错误?
How to avoid this 413 error ?
请求实体太大
所请求的资源/serverpath/reports.php不允许与POST请求请求数据,或请求中提供的数据量超过容量极限
The requested resource /serverpath/reports.php does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit.
Apache服务器在demo3.website_name端口80
Apache Server at demo3.website_name Port 80
因此,可以任何一个请帮助来设置php.ini文件,以及如何设置htaccess的,允许覆盖的状态
So, could any one please help to set php.ini and how to set htaccess to allow overwrite status
推荐答案
如何修复它在NGINX? client_max_body_size
要解决这个问题,你需要增加client_max_body_size指令的值。该指令规定数据的Nginx会接受一个HTTP请求的最大量。默认情况下此值设置为1兆字节,如果您尝试上传文件超过1兆字节的更大,你会得到一个错误413意思是:请求实体太大页。您可以在三个层面上插入这个指令:
To fix this, you need to increase the value of the client_max_body_size directive. This directive defines the maximum amount of data Nginx will accept in an HTTP request. By default this value is set to 1 megabyte, meaning if you attempt to upload a file larger than 1 megabyte you'll be getting an Error 413: Request entity too large page. You can insert this directive at three levels:
-
在HTTP模块:这将设置该指令值在configurationn所有的服务器和地点
In the http block: this will set the directive value for all server and locations in your configurationn
在服务器块:这将设置指令值一个特定服务器的所有位置
In the server block: this will set the directive value for all locations of one particular server
在定位板:这将设置一个特定的位置指令值在一个特定的服务器
In the location block: this will set the directive value for one specific location in a particular server
在这个例子中我将其插入我的HTTP块,并将其设置为500兆:
In this example I'm going to insert it in my http block and set it to 500 megabytes:
http {
client_max_body_size 500M; # allows file uploads up to 500 megabytes
[...]
}
来源: <一href="http://cnedelcu.blogspot.com.ar/2013/09/nginx-error-413-request-entity-too-large.html">http://cnedelcu.blogspot.com.ar/2013/09/nginx-error-413-request-entity-too-large.html
这篇关于如何避免请求实体太大413错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!