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

上传文件 nginx 413错误

2015-12-31 10:38 681 查看
nginx : 413 Request Entity Too Large

上传文件过程发生413 Request Entity Too Large错误,翻译为请求实体过大,断定为nginx限制了请求体大小,翻看nginx文档发现default: client_max_body_size 1m


client_max_body_size

syntax: client_max_body_size size

default: client_max_body_size 1m

context: http, server, location

Directive assigns the maximum accepted body size of client request, indicated by the line
Content-Length
in the header of request.

If size is greater the given one, then the client gets the error "Request Entity Too Large" (413).

It is necessary to keep in mind that the browsers do not know how to correctly show this error.


果断打开nginx/conf/nginx.conf,在http模块中增加 client_max_body_size 10m;

别忘记后面的分号

nginx/sbin/nginx -s reload

OK,问题解决;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: