Nginx 报错:client intended to send too large body
错误日志
[error] 177205#177205: *12060 client intended to send too large body:
原因
Nginx 配置中设置的最大文件大小过小,或者没有设置。
解决方法
修改 nginx.conf:
sendfile on;
client_max_body_size 20M; # MB
keepalive_timeout 120; # 秒
Nginx 重载配置文件:
nginx -s reload
sendfile 值为 on,指定使用 sendfile 系统调用来传输文件。sendfile 系统调用在两个文件描述符之间直接传递数据(完全在内核中操作),从而避免了数据在内核缓冲区和用户缓冲区之间的拷贝,操作效率很高,被称之为零拷贝。
版权声明:本文为 阡陌 的原创文章,遵循「CC BY-NC-SA 4.0」版权协议。若转载,请附上本文链接及本声明。
本文地址:https://www.mculoop.com/archives/83.html
若对本文有疑问可在评论区留言,我们看到后会尽量解答。