全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 1660|回复: 16

方法:让藏在cloudflare后的自建nextcloud绕过cloudflare上传限制

[复制链接]
发表于 2024-1-13 13:58:51 | 显示全部楼层 |阅读模式
省流总结:

通过修改配置文件以开启分片上传的方式,让藏在cloudflare之后的自建nextcloud绕过cloudflare免费版本身100M大小的上传限制。此方法对网页端和官方客户端上传有效,第三方客户端无效。

具体方法:

1.首先,需要确认自己的源站web服务器默认允许上传的最大限制在合适自己的范围内(可以通过检查相应的php.ini来确认)
2.登录到服务器,找到放置nextcloud站点的根目录,进入 apps/files/js 目录,找到 jquery.fileupload.js 这个文件,并使用文本编辑器打开。
3.跳转到第154行附近,找到 maxChunkSize 这个值,将其修改为其他数值即可

  1. // To upload large files in smaller chunks, set the following option
  2. // to a preferred maximum chunk size. If set to 0, null or undefined,
  3. // or the browser does not support the required Blob API, files will
  4. // be uploaded as a whole.
  5. maxChunkSize: undefined, //就是这个,这是默认情况下的
  6. // When a non-multipart upload or a chunked multipart upload has been
  7. // aborted, this option can be used to resume the upload by setting
  8. // it to the size of the already uploaded bytes. This option is most
  9. // useful when modifying the options object inside of the "add" or
  10. // "send" callbacks, as the options are cloned for each file upload.
  11. uploadedBytes: undefined,
复制代码


例如我们可以将其修改为 100000000 (约合98MB),然后保存并退出

  1. // To upload large files in smaller chunks, set the following option
  2. // to a preferred maximum chunk size. If set to 0, null or undefined,
  3. // or the browser does not support the required Blob API, files will
  4. // be uploaded as a whole.
  5. maxChunkSize: 100000000, //修改完成之后的数值
  6. // When a non-multipart upload or a chunked multipart upload has been
  7. // aborted, this option can be used to resume the upload by setting
  8. // it to the size of the already uploaded bytes. This option is most
  9. // useful when modifying the options object inside of the "add" or
  10. // "send" callbacks, as the options are cloned for each file upload.
  11. uploadedBytes: undefined,
复制代码


此时关闭掉原先的浏览器窗口,再打开浏览器就可以上传大于100M的文件了。
发表于 2024-1-13 15:01:49 | 显示全部楼层
redneck 发表于 2024-1-13 14:38
# vim /etc/php.ini
post_max_size = 100000M
upload_max_filesize = 100000M

套了cf 限制100 目的是每次通过cf的分片文件不拆过100
发表于 2024-1-13 14:38:03 | 显示全部楼层
# vim /etc/php.ini
post_max_size = 100000M
upload_max_filesize = 100000M

难道不是修改这里面的吗?
发表于 2024-1-13 15:52:36 | 显示全部楼层
牛逼收藏了
发表于 2024-1-13 15:58:25 | 显示全部楼层
虽说还没用next,但是先收藏
发表于 2024-1-13 18:35:05 | 显示全部楼层
好帖,这几天配置了nextcloud和qbittorrent结合,种子下好文件,在线看片,感觉还可以,就是看视频不知道哪里设置有问题,不是特别流畅
发表于 2024-1-13 18:38:10 | 显示全部楼层
牛逼, 收藏了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-5-11 01:08 , Processed in 0.066760 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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