Web Download problem

I have an seafile community server (6.0.8) on my Ubuntu 16.04.02 server. I installed on a different server (raspberry) Nginx as een reversed proxy. in the reversed proxy, like the manual, i’ve made an connection to my Ubuntu server. 1 location for seafile.mydomain.nl to 192.x.x.x:8000 and 1 location /seafhttp to 192.x.x.x:8082.

Now i’ve got the problem that when i download a file (2Gb+) in the webrowser the download starts but after 6 Mb it stops. After a couple of minutes it starts again and then it downloads the complete file. I can’t find a solution. Lots of google results end up in the client that doesn’t download but that’s not a problem.

Any Ideas?

What is the CPU status of nginx process, using top? I tried with a 1,2GB file and It went OK, Maybe nginx is not getting enough resources, because of the 2GB is bigger than rpi-RAM or tempfs is on RAM. I can imagine that this is due to buffering the 2 GB file or something similar.

Try to compare my settings with yours:

cat /etc/nginx/nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;

events {
        worker_connections 1024;
        multi_accept on;
        use epoll; ## essential for linux, optmized to serve many clients with each thread epoll;
}

        # Found in every manual:

        worker_rlimit_nofile 8000;

http {

        ##
        # Basic Settings
        ##

        client_max_body_size 0;
        sendfile on;
        directio 2m;
        reset_timedout_connection on;
        tcp_nopush on;
        tcp_nodelay on;
#       keepalive_timeout 65;
        types_hash_max_size 2048;
        server_tokens off;
#       client_body_timeout 12;
#        client_header_timeout 12;

        server_names_hash_bucket_size 128;
        # server_name_in_redirect off;
#       upload_progress proxied 1m;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;
        # Update charset_types due to updated mime.types
        charset_types text/css text/plain text/vnd.wap.wml application/javascript application/json application/rss+xml application/xml;

        ##
        # 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 warn;

        ##
        # Gzip Settings
        ##

        # Enable Gzip compressed

        gzip on;
        gzip_buffers 16 8k;

        # Enable compression both for HTTP/1.0 and HTTP/1.1.

        gzip_http_version  1.1;

        # Compression level (1-9).
        # 5 is a perfect compromise between size and cpu usage, offering about
        # 75% reduction for most ascii files (almost identical to level 9).

        gzip_comp_level    5;

        # Don't compress anything that's already small and unlikely to shrink much
        # if at all (the default is 20 bytes, which is bad as that usually leads to
        # larger files after gzipping).

        gzip_min_length    256;

        # Compress data even for clients that are connecting to us via proxies,
        # identified by the "Via" header (required for CloudFront).

        gzip_proxied      expired no-cache no-store private auth any;

        # Tell proxies to cache both the gzipped and regular version of a resource
        # whenever the client's Accept-Encoding capabilities header varies;
        # Avoids the issue where a non-gzip capable client (which is extremely rare
        # today) would display gibberish if their proxy gave them the gzipped version.

        gzip_vary          on;

        # Compress all output labeled with one of the following MIME-types.

        gzip_types
        application/atom+xml
        application/javascript
        application/json
        application/ld+json
        application/manifest+json
        application/rss+xml
        application/vnd.geo+json
        application/vnd.ms-fontobject
        application/x-font-ttf
        application/x-web-app-manifest+json
        application/xhtml+xml
        application/xml
        font/opentype
        image/bmp
        image/svg+xml
        image/x-icon
        text/cache-manifest
        text/css
        text/plain
        text/vcard
        text/vnd.rim.location.xloc
        text/vtt
        text/x-component
        text/x-cross-domain-policy;
        # text/html is always compressed by HttpGzipModule

        gzip_disable "msie6";

        ##
        # Virtual Host Configs
        ##

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

and with these:

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

#        client_max_body_size   0;
        proxy_connect_timeout   36000s;
        proxy_read_timeout      36000s;
        proxy_send_timeout      36000s;
        send_timeout            36000s;
        proxy_request_buffering off;      # works well with mp4
        proxy_buffering off;

        error_log       /var/log/nginx/seafhttp_error.log;
        access_log      off;
    }

Proxy_request_buffering results in a nginx that doesn’t starts. Then i added only proxy_buffering off to my nginx configuration and it worked. Now the download starts immediately.

SUDO TOP doesn’t give any result what i understand. %MEM isn’t growing.

Great!

I use nginx version: nginx/1.10.3, therefore