Error downloading a file larger than 30 megabytes

Hello everyone.
Help solve the problem - files weighing more than 30 megabytes are not downloaded from the cloud.The file tries to download several times and eventually writes a download error.
My configuration:
Rocky Linux 8.9.
Seafile server v9.0.10.
The cloud is used through the browser.
A reverse proxy is also used.
I will attach any log or configuration files on request.

Do you get some of the file but just not all of it, or does it fail before you get anything? Do you get an error message? Does the reverse proxy’s log have an error? If the reverse proxy is nginx or apache you might want to compare your configuration to the one in the manual to see if any significant difference stands out. HTTPS with Nginx - Seafile Admin Manual

Now files over 30 megabytes are also not downloaded (there were 100+).

The file is trying to download, after several attempts, an error appears when downloading the file.
Im use nginx.
I can’t figure out which specific log will contain the file download error.

**My nginx.conf settings (/etc/nginx/nginx.conf):**

user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log notice;
pid        /var/run/nginx.pid;

events {
    worker_connections 1024;
    multi_accept on;
    use epoll;
}

http {
    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile on;
    aio on;
    tcp_nopush on;
    server_tokens off;
    server_names_hash_bucket_size 128;
    client_max_body_size 100m;
    tcp_nodelay on;
    client_body_timeout 12;
    client_header_timeout 12;
    keepalive_timeout 15;
    send_timeout 10;
    gzip off;

    include /etc/nginx/conf.d/*.conf;
}
~                            
**My nginx.conf settings (/etc/nginx/conf.d/xx.conf):**

# Required for only office document server
map $http_x_forwarded_proto $the_scheme {
    default $http_x_forwarded_proto;
    "" $scheme;
}
map $http_x_forwarded_host $the_host {
    default $http_x_forwarded_host;
    "" $host;
}
map $http_upgrade $proxy_connection {
    default upgrade;
    "" close;
}

log_format seafileformat '$http_x_forwarded_for $remote_addr [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $upstream_response_time';

server {
    listen 80;
    server_name *myservername*;

    proxy_set_header X-Forwarded-For $remote_addr;

    location / {
         proxy_pass         http://127.0.0.1:8000;
         proxy_set_header   Host $host;
         proxy_set_header   X-Real-IP $remote_addr;
         proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header   X-Forwarded-Host $server_name;
         proxy_set_header   X-Forwarded-Proto $scheme;
         proxy_read_timeout  1200s;

         # used for view/edit office file via Office Online Server
         client_max_body_size 0;

         access_log      /var/log/nginx/seahub.access.log seafileformat;
         error_log       /var/log/nginx/seahub.error.log;
    }

    location /onlyofficeds/ {
        proxy_pass http://127.0.0.1:88/;
        proxy_http_version 1.1;
        client_max_body_size 100M;
        proxy_read_timeout 3600s;
        proxy_connect_timeout 3600s;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $proxy_connection;
        proxy_set_header X-Forwarded-Host $the_host/onlyofficeds;
        proxy_set_header X-Forwarded-Proto $the_scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
  location /seafhttp {
        rewrite ^/seafhttp(.*)$ $1 break;
        proxy_pass http://127.0.0.1:8082;
        client_max_body_size 0;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_connect_timeout  36000s;
        proxy_read_timeout  36000s;

        access_log      /var/log/nginx/seafhttp.access.log seafileformat;
        error_log       /var/log/nginx/seafhttp.error.log;
    }
    location /media {
        root /opt/seafile/seafile-server-latest/seahub;
    }
    location /seafdav {
        proxy_pass         http://127.0.0.1:8080/seafdav;
        proxy_set_header   Host $host;
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Host $server_name;
        proxy_set_header   X-Forwarded-Proto $scheme;
        proxy_read_timeout  1200s;

        client_max_body_size 0;

        access_log      /var/log/nginx/seafdav.access.log seafileformat;
        error_log       /var/log/nginx/seafdav.error.log;
    }
}

I just compared your nginx to mine. It looks pretty similar, excep in the “location /seafhttp {” section I have these 2 lines extra:

# Hopefully will fix large file uploads through web interface failing after a 10s of MB
proxy_request_buffering off;

I’m no expert, but I think what that does to tell nginx to just immediately pass data on. Without it, I think nginx tries to buffer uploads (and maybe downloads) in a temp file until it has the entire file, and then it passes that file on to seafile. For me /tmp would fill up, and then the transfer would fail. I had this problem on uploads so maybe it’s unrelated, but it feels worth trying to add that.

If that doesn’t work, you could try to bypass the reverse proxy and talk to seafile directly by editing the download link to replace http://ip_address/seafhttp with http://ip_address:8082/seafhttp. You might have to do that with curl or wget directly from that server since it’s likely that the seafile ports are only available from that host, and not on the network. If that fails too then at least we know not to worry about the nginx config.

Also check you nginx logs. For me errors related to this would show up in /var/log/nginx/error.log or /var/log/nginx/seafhttp.error.log.

Thanks for your reply.
Added this line to my nginx file.
I will test it.