1. 首页
  2. 系统运维
  3. Linux

PHP上传失败,Nginx错误 client intended to send too large body

一个roundcube的邮件系统,上传附件的时候提示上传附件失败。结合php+nginx的结构,最大可能就是nginx的配置问题。查看nginx日志,看到错误日志类似如下:

2022/06/30 23:02:02 [error] 2050#0: *6896 client intended to send too large body: 13707422 bytes, client: 39.185.210.24, server: mail.szl724.com, request: "POST /roundcube/?_task=mail&_remote=1&_from=compose&_id=22456968662be616b528a2&_uploadid=upload1656644522065&_action=upload HTTP/1.1", host: "mail.szl724.com", referrer: "http://mail.szl724.com/roundcube/?_task=mail&_action=compose&_id=22456968662be616b528a2"
2022/06/30 23:02:51 [notice] 2242#0: signal process started

打开nginx配置文件/etc/nginx/nginx.conf

在http模块中增加配置

client_max_body_size 100m;
PHP上传失败,Nginx错误 client intended to send too large body

修改后重新载入nginx

联系我们

0574-55011290

QQ:248687950

邮件:admin@nbhao.org

工作时间:周一至周五,9:00-18:00,节假日休息

QR code