您的位置:首页 > 运维架构 > Nginx

nginx 客户端请求大小限制

2016-01-23 16:29 676 查看
SYNTAX: client_max_body_size size;
DEFAULT:
client_max_body_size 1m;
CONTEXT:    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.


今天上传图片,发现老出错,也没超过程序所设的大小限制,为啥就不行。后来突然想起来以前用nginx接tomcat也出现过,后来证明是nginx默认设置导致的。

在server节点下增加 client_max_body_size 4m; 搞定。nginx 默认限制是1m
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: