Local galaxy nginx max file download size 1GB

If I download a file, fasta or zip of lets say 3GB the downloaded file is always max 1GB. Where do I need to look to solve this?

I tried to add proxy_max_temp_file_size 0; to my nginx.conf but that is not working.
In my galaxy.log I get the following error:

uwsgi_response_write_body_do() TIMEOUT !!!
IOError: write error

EDIT:

I am still searching for a solution (and a cause) so here an update. My problem is not solved yet.
At the moment I have two galaxy servers running, both a different server. Using x-accel-redirect solves my problem only for one of the servers. The difference between them is that on the one were it does not work the database/files folder is located on a mounted volume. If I click the save icon to download some files I get a sort of page not found error, I will check the actual error in a moment because it is slightly different. I already found that it can have to do with reading rights but I gave the full rights to every one on the database/files folder.

EDIT 2:
I just mounted a volume on the galaxy where I did not had problems and everything still works. It is clearly not a galaxy problem. If I find the cause I will post it.

EDIT 3: The solution and cause

I still not fully understand it myself but it is solved and I know the cause. So in my case the path to the files folder looks like this: /media/galaxy/database/files.
The galaxy folder had the rights drwxrwxrwx (777), I just changed the rights to drwxr-xr-x (755) and now it works.

2 Likes

Yeah, my first guess here would be proxy_max_temp_file_size, too. You restarted nginx after setting that value, right?

On second thought, it sounds like maybe you haven’t set up nginx to serve the files directly? You might want to try x-accel-redirect via the following instructions, if you haven’t already.
https://docs.galaxyproject.org/en/master/admin/special_topics/nginx.html#sending-files-using-nginx

1 Like

First of all thanks for your reply, I will edit my original question with an update and maybe you or some one else can still point me in the right direction. I am working on the x-accel-redirect solution

Sounds good, thank you for posting an update. It looks like you’re on the right track now, but let me know if I can provide any more info, good luck!

In case x-accel-redirect cannot be used (like if you are using S3 object store) you can turn off nginx proxy buffering with something like below. That solved it for me.

    location ~ ^/api/dataset_collections/([^/]+)/download/?$ {
        uwsgi_buffering off;
        uwsgi_max_temp_file_size 0;
        proxy_buffering off;
        proxy_max_temp_file_size 0;
        uwsgi_pass 127.0.0.1:8080;
        uwsgi_param UWSGI_SCHEME $scheme;
        include uwsgi_params;
    }
2 Likes

Adding below two lines in NGINX(nginx.conf or default.conf) worked for me.

proxy_buffering off;
proxy_max_temp_file_size 0;

1 Like