nginx 更改配置client_max_body_size没有生效 nginx.conf 修改默认限制上传附件大小
来源:互联网 发布:淘宝上的小样是真是假? 编辑:程序博客网 时间:2024/06/05 00:18
nginx.conf
在nginx使用过程中,上传文件的过程中,通常需要设置nginx报文大小限制。避免出现413 Request Entity Too Large。
于是奇葩的问题被我们遇到了,详细配置请参考下面。我们的问题是,无论client_max_body_size设置在哪里,nginx -s reload后,依然一直报413.多次尝试reload,始终无效。最终决定kill 进程,restart,终于好了。
由此可见,nginx reload并不一定好使。有时候,为了保险起见。restart比较靠谱。不知道别人有没有遇到同样的问题。希望对大家有帮助!~~
设置如下:
client_max_body_size size
;
client_max_body_size 1m;
http
, server
, location
Sets the maximum allowed size of the client request body, specified in the “Content-Length” request header field.
If the size in a request exceeds the configured value, the 413 (Request Entity Too Large) error is returned to the client.
Please be aware that browsers cannot correctly display this error.
Setting size
to 0 disables checking of client request body size.
可以选择在http{ }中设置:client_max_body_size 20m;
也可以选择在server{ }中设置:client_max_body_size 20m;
还可以选择在location{ }中设置:client_max_body_size 20m;
三者到区别是:http{} 中控制着所有nginx收到的请求。而报文大小限制设置在server{}中,则控制该server收到的请求报文大小,同理,如果配置在location中,则报文大小限制,只对匹配了location 路由规则的请求生效。
http{
#控制全局nginx所有请求报文大小
#client_max_body_size 20m;
server{
#控制该server的所有请求报文大小
#client_max_body_size 20m;
location a {
}
location b{
#控制满足该路由规则的请求报文大小
#client_max_body_size 20m;
}
}
server {
}
}
- nginx 更改配置client_max_body_size没有生效 nginx.conf 修改默认限制上传附件大小
- nginx 更改配置client_max_body_size没有生效
- nginx 1.4.6 设置上传大小 client_max_body_size
- nginx 1.4.6 设置上传大小 client_max_body_size
- nginx配置的client_max_body_size没有效果
- nginx+php 修改文件上传大小限制
- 修改PHP服务器文件上传大小限制-apache,lighttpd,nginx
- 修改Nginx与PHP的文件上传大小限制
- 修改PHP服务器文件上传大小限制-apache,lighttpd,nginx
- 修改nginx的上传文件的大小限制
- Nginx服务器+PHP修改文件上传的大小限制
- 修改Nginx与PHP的文件上传大小限制
- nginx默认nginx.conf
- 修改Bugfree上传附件大小限制
- 修改WordPress中附件上传大小限制
- 修改WordPress中附件上传大小限制
- nginx+php 上传文件大小的问题client_max_body_size
- nginx修改上传文件大小限制
- 脉冲同步器
- POJ2584 T-Shirt Gumbo【二分图多重匹配】
- java.lang.NoSuchMethodError: No virtual method checkSelfPermission,可是这个方法存在
- ubuntu 16.04 SVN服务器搭建与windows客户端连接
- 圣杯布局和双飞翼布局
- nginx 更改配置client_max_body_size没有生效 nginx.conf 修改默认限制上传附件大小
- python基础知识——数组拼接(以iris数据为例……)
- AOP--Aspect Oriented Programming
- 1006. 换个格式输出整数 (15)用时9min一次通过
- Bootstrap 模态框(Modal)插件
- 接入sdk 采用aar jar 插件方式踩坑
- Chrome Extension notifications【谷歌浏览器扩展之弹窗通知】
- CTF web题总结--LFI
- static与extern