Web interface says upload error but completes on large files

Hello, I am using seafile server verison 6.0.9 on a raspberry pi3. When I upload big files (over 2 gigs) on the web interface, the upload will complete, say saving, stay saving for a long time then I get an “upload error” message. The file does actually upload because if I refresh the library a few minutes later, the file is there. I even re downloaded the file to make sure it was good and it was. It may just be indexing and times out because there is no transfer of data and the connection is dropped. If I use the client to upload files, it goes through fine regardless of the size. This seems to have happened only after I installed the nginx server. I’m guessing there is some setting on the nginx server I need to change but I have no idea where to start.

Please post your Nginx config.

_Here you go _
-------------------------------------------------
user www-data;
worker_processes 2;
pid /run/nginx.pid;

events {
_ worker_connections 128;_
_ # multi_accept on;_
}

http {

_ ##_
_ # Basic Settings_
_ ##_

_ sendfile on;_
_ tcp_nopush on;_
_ tcp_nodelay on;_
_ keepalive_timeout 60;_
_ types_hash_max_size 2048;_
_ # server_tokens off;_

_ # server_names_hash_bucket_size 64;_
_ # server_name_in_redirect off;_

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

_ ##_
_ # SSL Settings_
_ ##_

_ ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE_
_ ssl_prefer_server_ciphers on;_

_ ##_
_ # Logging Settings_
_ ##_

_ access_log /var/log/nginx/access.log;_
_ error_log /var/log/nginx/error.log;_

_ ##_
_ # Gzip Settings_
_ ##_

_ gzip on;_
_ gzip_disable “msie6”;_

_ # gzip_vary on;_
_ # gzip_proxied any;_
_ # gzip_comp_level 6;_
_ # gzip_buffers 16 8k;_
_ # gzip_http_version 1.1;_
_ # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;_

_ ##_
_ # Virtual Host Configs_
_ ##_

_ include /etc/nginx/conf.d/.conf;_
_ include /etc/nginx/sites-enabled/
;_
}

#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities “TOP” “USER”;
# # imap_capabilities “IMAP4rev1” “UIDPLUS”;
#
# server {

# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}
-----------------------------------------------

Your vhost config, the default nginx config is mostly fine. :slight_smile:
Please post as codeblock.

I’m not completey sure but I think this what you are looking for. This is in /etc/nginx/sites-available

server {
listen 443;
ssl on;
ssl_protocols TLSv1.1 TLSv1.2;
ssl_certificate /etc/letsencrypt/live/rcheung.servebeer.com/fullchain.p$
ssl_certificate_key /etc/letsencrypt/live/rcheung.servebeer.com/privkey$
server_name seafilepi;
error_page 497 https://$host:$server_port$request_uri;

    client_max_body_size 0;

   location / {
        fastcgi_pass 127.0.0.1:8000;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_script_name;
        fastcgi_param SERVER_PROTOCOL $server_protocol;
        fastcgi_param QUERY_STRING $query_string;
        fastcgi_param REQUEST_METHOD $request_method;
        fastcgi_param CONTENT_TYPE $content_type;
        fastcgi_param CONTENT_LENGTH $content_length;
        fastcgi_param SERVER_ADDR $server_addr;
        fastcgi_param SERVER_PORT $server_port;
        fastcgi_param SERVER_NAME $server_name;
        fastcgi_param HTTPS on;
        fastcgi_param HTTP_SCHEME https;

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

location /seafhttp {
rewrite ^/seafhttp(.*)$ $1 break;
proxy_pass http://127.0.0.1:8082;
client_max_body_size 0;
}

    location /media {
        root /home/seafile/cloud/seafile-server-latest/seahub;
        # include /etc/nginx/mime.types; # <--- UNCOMMENT THIS IF CSS FILES$
   }
}

Please compair your config with this example here:
https://manual.seafile.com/deploy/https_with_nginx.html

My guess would be that your FASTCGI timeouts are to small.

You were correct. Issue is resolved now thanks.

I was missing in my config

fastcgi_read_timeout 36000;

and

        proxy_connect_timeout  36000s;
        proxy_read_timeout  36000s;
        proxy_send_timeout  36000s;
        send_timeout  36000s;
1 Like