# 2GB Download Limit Nextcloud - Letsenrcypt - Unraid

**URL:** <https://help.nextcloud.com/t/2gb-download-limit-nextcloud-letsenrcypt-unraid/71375>\
**Category:** 📦 Appliances (Docker, Snappy, VM, NCP, AIO)\
**Created:** [February 17, 2020, 2:55pm UTC](https://help.nextcloud.com/t/2gb-download-limit-nextcloud-letsenrcypt-unraid/71375 "2020-02-17T14:55:59Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![antagon](https://help.nextcloud.com/letter_avatar/antagon/32/6_22734026db12803ebb3e059622ac3534.png) [@antagon](https://help.nextcloud.com/u/antagon)\
**Post date:** [February 17, 2020, 2:55pm UTC](https://help.nextcloud.com/t/2gb-download-limit-nextcloud-letsenrcypt-unraid/71375/1 "2020-02-17T14:55:59Z")

</div>

Hi,  
I´m using Nextcloud on my Unraid Server proxied by letsencrypt with my own domain/ subdomain setup.

Runs fine, but when I try to download files bigger then 2gb from my cloud I always get a network error and the download stops at 2GB.

I found a few threads in the net but none of it provided a solution for my problem. If there´s anyone around here who can help, what´s the necessary info I need to provide for troubleshooting?

---

<div class="post-metadata">

**Author:** ![Capusjon](https://help.nextcloud.com/letter_avatar/capusjon/32/6_22734026db12803ebb3e059622ac3534.png) [@Capusjon](https://help.nextcloud.com/u/Capusjon)\
**Post date:** [February 26, 2020, 9:38pm UTC](https://help.nextcloud.com/t/2gb-download-limit-nextcloud-letsenrcypt-unraid/71375/2 "2020-02-26T21:38:53Z")

</div>

Having exactly the same problem on open mediavault.  
the I think I have traced the error back to the nginx log of the let’s encrypt docker.

> 2020/02/26 22:08:28 [error] 390#390: _736 upstream prematurely closed connection while reading upstream, client: XXX.XXX.XXX.XXX, server: XXXXX._, request: "GET /s/[FILE]

I don’t know if this part of the nextcloud.subdomain.conf is responsible:

> location / {  
> include /config/nginx/proxy.conf;  
> resolver 127.0.0.11 valid=30s;  
> set $upstream\_nextcloud nextcloud;  
> proxy\_max\_temp\_file\_size 2048m;  
> proxy\_pass https://$upstream\_nextcloud:443;

proxy\_max\_temp\_file\_size 2048m; this in particular.

Any insights?

---

<div class="post-metadata">

**Author:** ![Capusjon](https://help.nextcloud.com/letter_avatar/capusjon/32/6_22734026db12803ebb3e059622ac3534.png) [@Capusjon](https://help.nextcloud.com/u/Capusjon)\
**Post date:** [February 26, 2020, 10:22pm UTC](https://help.nextcloud.com/t/2gb-download-limit-nextcloud-letsenrcypt-unraid/71375/3 "2020-02-26T22:22:30Z")

</div>

I tried editing the nextcloud.subdomain.conf and it did the trick for me, a file of ± 3gb downloaded without a problem via public sharing link in chrome.

what I did:  
go to your let’s encrypt config folder i.e. config\Letsencrypt\nginx\proxy-confs

look there for the nextcloud.subdomain.conf. edit it with notepad++ or something.

> change proxy\_max\_temp\_file\_size 2048m;

to

> proxy\_max\_temp\_file\_size 8192m;

8192 is just a multitude of 2048 but I think 10000 could do as well.

I think the only thing you need to keep in mind is that this temp file will be written to your docker image. So the disk containing this image must be big enough to handle the file. I am not entirely sure but this is what I could make of it after an evening testing and reading up.

Hope this helps you out.

Capusjon

---

<div class="post-metadata">

**Author:** ![Capusjon](https://help.nextcloud.com/letter_avatar/capusjon/32/6_22734026db12803ebb3e059622ac3534.png) [@Capusjon](https://help.nextcloud.com/u/Capusjon)\
**Post date:** [February 26, 2020, 11:23pm UTC](https://help.nextcloud.com/t/2gb-download-limit-nextcloud-letsenrcypt-unraid/71375/4 "2020-02-26T23:23:42Z")

</div>

I found the bigger temp file was causing trouble for my smaller SSD hosting the OS and the dockers.

[Found](https://github.com/linuxserver/docker-letsencrypt/issues/56)

> -v /YOUR/LOCATION:/var/lib/nginx/tmp

as a possible solution for mapping the temp folder to your host. Didn’t try it yet though.

---

<div class="post-metadata">

**Author:** ![antagon](https://help.nextcloud.com/letter_avatar/antagon/32/6_22734026db12803ebb3e059622ac3534.png) [@antagon](https://help.nextcloud.com/u/antagon)\
**Post date:** [February 27, 2020, 8:29am UTC](https://help.nextcloud.com/t/2gb-download-limit-nextcloud-letsenrcypt-unraid/71375/5 "2020-02-27T08:29:53Z")

</div>

Awesome thank you. It works for me as well. I put it to 16384.

---

<div class="post-metadata">

**Author:** ![Capusjon](https://help.nextcloud.com/letter_avatar/capusjon/32/6_22734026db12803ebb3e059622ac3534.png) [@Capusjon](https://help.nextcloud.com/u/Capusjon)\
**Post date:** [February 27, 2020, 8:49am UTC](https://help.nextcloud.com/t/2gb-download-limit-nextcloud-letsenrcypt-unraid/71375/6 "2020-02-27T08:49:53Z")

</div>

Just be sure that you have 16384 mb free space on your OS disk. You should be fine that way, else you can try to compose your lets encrypt docker with:

> -v /YOUR/LOCATION:/var/lib/nginx/tmp

Glad it worked for you!

---

<div class="post-metadata">

**Author:** ![MeiRos](https://help.nextcloud.com/user_avatar/help.nextcloud.com/meiros/32/8211_2.png) [@MeiRos](https://help.nextcloud.com/u/MeiRos)\
**Post date:** [February 27, 2020, 9:32am UTC](https://help.nextcloud.com/t/2gb-download-limit-nextcloud-letsenrcypt-unraid/71375/7 "2020-02-27T09:32:51Z")

</div>

Have you tried to turn it off?  
`proxy_max_temp_file_size 0;`

---

<div class="post-metadata">

**Author:** ![Capusjon](https://help.nextcloud.com/letter_avatar/capusjon/32/6_22734026db12803ebb3e059622ac3534.png) [@Capusjon](https://help.nextcloud.com/u/Capusjon)\
**Post date:** [February 27, 2020, 10:20am UTC](https://help.nextcloud.com/t/2gb-download-limit-nextcloud-letsenrcypt-unraid/71375/8 "2020-02-27T10:20:21Z")

</div>

Next thing I will try is:

> proxy\_max\_temp\_file\_size 0;

for now my OS which hosts the docker image only has 9GB of free space left. If someone would download a file bigger then 9GB it would swallow all space left. I did rebuild the docker mapping  
/var/lib/nginx/tmp to a new folder on my filesystem. This seems to work for me so now I have 80GB free for the temporary file to use. (no 80GB files on my system but by downloading a lot of files at the same time you could hit this)

I’ll report back if I find something is off…

---

<div class="post-metadata">

**Author:** ![Capusjon](https://help.nextcloud.com/letter_avatar/capusjon/32/6_22734026db12803ebb3e059622ac3534.png) [@Capusjon](https://help.nextcloud.com/u/Capusjon)\
**Post date:** [March 3, 2020, 1:21pm UTC](https://help.nextcloud.com/t/2gb-download-limit-nextcloud-letsenrcypt-unraid/71375/9 "2020-03-03T13:21:57Z")

</div>

client\_max\_body\_size 0;  
location / {  
include /config/nginx/proxy.conf;  
resolver 127.0.0.11 valid=30s;  
set $upstream\_nextcloud nextcloud;  
**proxy\_max\_temp\_file\_size 2040m;** made this **proxy\_max\_temp\_file\_size 0** ;

proxy\_pass https://$upstream\_nextcloud:443;

With this setting in place the buffer file when sharing a link can get as big as needed. (keep in mind that this will ‘grow’ your docker image so you need enough space on the disk where docker runs or you need to map the temp folder of the image to another drive)

This was actually the only thing I needed to change to get bigger files (movies, series, etc) to download, So thanks MeiRos!

I still have a problem though:  
Whenever I transfer a big file from “SMB/CIFS A” to “SMB/CIFS B” I get a timeout in the android app or a could not move FILENAME when trying via Web interface.  
The transfer does complete eventually though so most things seem to be working.

Letsencrypt/NGINX error log:

2020/03/03 10:05:33 [error] 392#392: \*1878 FastCGI sent in stderr: “Primary script unknown” while reading response header from upstream, client: XXX.XXX.XXX.XXX, server: \_, request: “GET ///user/recordings.php HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “XXX.XXX.XXX.XXX”

2020/03/03 11:18:52 [error] 392#392: \*3369 FastCGI sent in stderr: “Primary script unknown” while reading response header from upstream, client: 5.101.0.209, server: \_, request: “GET /index.php?s=/Index/\think\app/invokefunction&function=call\_user\_func\_array&vars[0]=md5&vars[1][]=HelloThinkPHP HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “xxx.xxx.xxx.xxx”, referrer: “[http://xxx.xxx.xxx.xxx:80/index.php?s=/Index/\think\app/invokefunction&function=call\_user\_func\_array&vars[0]=md5&vars[1][]=HelloThinkPHP](http://xxx.xxx.xxx.xxx:80/index.php?s=/Index/%5Cthink%5Capp/invokefunction&function=call_user_func_array&vars%5B0%5D=md5&vars%5B1%5D%5B%5D=HelloThinkPHP)”

Nexcloud/NGINX error log:  
2020/03/03 11:55:20 [error] 352#352: \*4854 upstream timed out (110: Operation timed out) while reading response header from upstream, client: XXX.XXX.XXX.XXX, server: \_, request: “MOVE /remote.php/dav/files/Colin/Discovery/Downloads/21%20Jump%20Street%202012%20BluRay.720p.DTS.x264-CHD HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “host.hosting.host”

Any clue as to what I might have missed so I can fix this as well?

Kind regards,  
Capusjon

---

<div class="post-metadata">

**Author:** ![Capusjon](https://help.nextcloud.com/letter_avatar/capusjon/32/6_22734026db12803ebb3e059622ac3534.png) [@Capusjon](https://help.nextcloud.com/u/Capusjon)\
**Post date:** [March 8, 2020, 12:20pm UTC](https://help.nextcloud.com/t/2gb-download-limit-nextcloud-letsenrcypt-unraid/71375/10 "2020-03-08T12:20:23Z")

</div>

For anybody having this issue and coming here for a fix, I managed to get it working eventually:

It turned out to be a fastCGI timeout in LetsEncrypt or Nextcloud, I am not really sure which one because I edited both nginx.conf files to allow for a bigger fastcgi timeout.

nginx.conf http section

> http {
> 
> ## 
> 
> # Basic Settings
> 
> ## 
> 
> sendfile on;  
> tcp\_nopush on;  
> tcp\_nodelay on;  
> keepalive\_timeout 3600;  
> types\_hash\_max\_size 2048;
> 
> **# Timeout tryouts**  
> #proxy\_connect\_timeout 600;  
> #proxy\_send\_timeout 600;  
> #proxy\_read\_timeout 600;  
> #send\_timeout 600;  
> **fastcgi\_read\_timeout 3600;**  
> **fastcgi\_send\_timeout 3600;**  
> #fastcgi\_connect\_timeout 300;  
> #client\_header\_timeout 300;  
> #client\_body\_timeout 300;

I put the bold fastcgi settings in the conf file and the timeouts after 1 minute disappeared. Mabey there is a better way, I hope someone hovers over and can point it out to me.  
For me this seems to work at least.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 11, 2024, 8:42pm UTC](https://help.nextcloud.com/t/2gb-download-limit-nextcloud-letsenrcypt-unraid/71375/11 "2024-12-11T20:42:58Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 11, 2024, 8:42pm UTC](https://help.nextcloud.com/t/2gb-download-limit-nextcloud-letsenrcypt-unraid/71375/12 "2024-12-11T20:42:59Z")

</div>


