nextcloud 上传10GB文件后,提示组块时出错 502 - nginx 超时限制设置

现象:nextcloud 需要上传超过10GB的文件,但上传完成后“组块时出错 502”。nginx 的web错误信息里有如:

recv() failed (104: Connection reset by peer) while reading response header from upstream request: "MOVE /remote.php/dav/uploads/name/web-file-upload-nnnn/.file" HTTP/1.1, upstream: fastcgi://unix:/tmp/php-cgi-72.sock

nextcloud-big-file-502-1.png

查看 php-fpm.log 的日志,如:

WARNING: [pool www] child nnnn, script '/www/wwwroot/nextcloud/remote.php'(request: "MOVE /remote.php") execution timed out (104.723765 sec). Terminating.
WARNING: [pool www] child nnnn exited on signal 15 (SIGTERM) after 13101.403079 seconds from start

nextcloud-big-file-502-2.png

估计是 php-fpm 的进程在约100秒后超时,被强制退出,然后重新创建进程了。

解决:在“宝塔”面板的php7.2管理配置窗口中,将“超时限制”(request_terminate_timeout)的时间上调,如从默认100秒的,上调到17200。

nextcloud-big-file-502-4.png

参考:

标签: nginx, nextcloud

添加新评论