413 Request Entity Too Large

简介: Nginx出现413 Request Entity Too Large错误解决方法 [导读] Nginx出现的413 Request Entity Too Large错误,这个错误一般在上传文件的时候出现,打开nginx主配置文件nginx conf,找到http{}段,添加解决方法就是打开n...

Nginx出现413 Request Entity Too Large错误解决方法

[导读] Nginx出现的413 Request Entity Too Large错误,这个错误一般在上传文件的时候出现,打开nginx主配置文件nginx conf,找到http{}段,添加解决方法就是打开nginx主配置文件nginx conf,一般在 usr local ngin

Nginx出现的413 Request Entity Too Large错误,这个错误一般在上传文件的时候出现,打开nginx主配置文件nginx.conf,找到http{}段,添加

解决方法就是

打开nginx主配置文件nginx.conf,一般在/usr/local/nginx/conf/nginx.conf这个位置,找到http{}段,修改或者添加

 代码如下 复制代码

client_max_body_size 2m;

然后重启nginx,

 代码如下 复制代码

sudo /etc/init.d/nginxd reload

 即可。
要是以php运行的话,这个大小client_max_body_size要和php.ini中的如下值的最大值差不多或者稍大,这样就不会因为提交数据大小不一致出现错误。

 代码如下 复制代码

post_max_size = 2M
upload_max_filesize = 2M

重启NGINX

 代码如下 复制代码
kill -HUP `cat /usr/local/nginx/nginx.pid `

恢复正常

目录
相关文章
|
4月前
|
中间件 应用服务中间件 Apache
Higress有对max_request_bytes做限制吗?我有个应用上传文件报413 request entity too large错误
Higress有对max_request_bytes做限制吗?我有个应用上传文件报413 request entity too large错误
41 0
|
5月前
|
应用服务中间件 nginx
413 request entity too large 解决办法
413 request entity too large 解决办法
199 0
|
5月前
request.getParameter、request.getParameterValues、request.getParameterMap用法
request.getParameter、request.getParameterValues、request.getParameterMap用法
|
7月前
|
应用服务中间件 nginx
解决nginx 出现 413:Request Entity Too Large
解决nginx 出现 413:Request Entity Too Large
110 0
|
10月前
|
Java Spring
【feign】Could not write request: no suitable HttpMessageConverter found for request type
【feign】Could not write request: no suitable HttpMessageConverter found for request type
292 0
|
11月前
|
测试技术
Elasticsearch-circuit_breaking_exception [parent] Data too large, data for [<http_request>]
Elasticsearch-circuit_breaking_exception [parent] Data too large, data for [<http_request>]
159 0
|
运维 前端开发 JavaScript
解决 413 Request Entity Too Large
解决 413 Request Entity Too Large
559 0
解决 413 Request Entity Too Large
|
Java Spring
springmvc:405 request method post not supported
springmvc:405 request method post not supported
131 0
|
应用服务中间件 nginx
“413 Request Entity Too Large”问题处理
“413 Request Entity Too Large”问题处理
“413 Request Entity Too Large”问题处理
|
应用服务中间件 nginx
当你使用Nginx服务器时出现413 Request Entity Too Large
413 Request Entity Too Large 这是因为传输文件过大,超出了Nginx的限制。 你可以修改nginx.conf 进入nginx.conf