找回密码
 立即注册
搜索
查看: 376|回复: 0

Nginx 报错:client intended to send too large body

[复制链接]

266

主题

0

回帖

1119

积分

管理员

积分
1119
发表于 2023-12-26 00:05:34 | 显示全部楼层 |阅读模式

错误日志

[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 系统调用在两个文件描述符之间直接传递数据(完全在内核中操作),从而避免了数据在内核缓冲区和用户缓冲区之间的拷贝,操作效率很高,被称之为零拷贝。


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|棱讯科技 ( 粤ICP备2024228160号-2|粤公网安备44030002003510号 )

GMT+8, 2024-7-27 17:27 , Processed in 0.014139 second(s), 5 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表