文档说明
根据nextcloud的官方文档,缺省可以上传的最大文件大小为 512M。以下是管理员官方文档的说明,摘自https://docs.nextcloud.com//server/14/admin_manual/configuration_files/big_file_upload_configuration.html:
The default maximum file size for uploads is 512MB. You can increase this limit up to what your filesystem and operating system allows. There are certain hard limits that cannot be exceeded:
- < 2GB on 32Bit OS-architecture
- < 2GB with IE6 - IE8
- < 4GB with IE9 - IE11
64-bit filesystems have much higher limits; consult the documentation for your filesystem.
我使用nginx + php7.2-fpm
nginx
Since nginx 1.7.11 a new config option fastcgi_request_buffering is availabe. Setting this option to fastcgi_request_buffering off;
in your nginx config might help with timeouts during the upload. Furthermore it helps if you’re running out of disc space on the tmp partition of your system.
Note
Make sure that client_body_temp_path
points to a partition with adequate space for your upload file size, and on the same partition as the upload_tmp_dir
or tempdirectory
(see below). For optimal performance, place these on a separate hard drive that is dedicated to swap and temp storage.
If your site is behind a nginx frontend (for example a loadbalancer):
By default, downloads will be limited to 1GB due to proxy_buffering
and proxy_max_temp_file_size
on the frontend.
- If you can access the frontend’s configuration, disable proxy_buffering or increase proxy_max_temp_file_size from the default 1GB.
- If you do not have access to the frontend, set the X-Accel-Buffering header to
add_header X-Accel-Buffering no;
on your backend server.
修改nginx配置脚本
sudo vi /etc/nginx/sites-available/cloud
将配置文件中的
client_max_body_size 512M;
改为
client_max_body_size 2048M;
具体的cloud配置文件可以参见https://blog.csdn.net/justidle/article/details/102874134。
重新启动服务
sudo systemctl restart php7.2-fpm
sudo systemctl restart nginx
P.S.
到底有没有起作用,没有测试过。