NC 17 Large downloads abort

Nextcloud version: 17.0.2
Operating system and version: Ubuntu 18.04.3 LTS
Apache or nginx version (eg, Apache 2.4.25):
PHP version: 7.3

The issue you are facing:
Large downloads >1GB always break off after some time.

Is this the first time you’ve seen this error?:
The error occurs for the first time but with some users and files.

Steps to replicate it:

  1. Create a link share
  2. Download via the browser
  3. wait for abort

The output of your Nextcloud log in Admin > Logging:

Do not find a relevant message in the log.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'passwordsalt' => '',
  'trusted_domains' => 
  array (
    0 => '',
  ),
  'datadirectory' => '/var/www/',
  'skeletondirectory' => '/var/www//_skeleton',
  'dbtype' => 'mysql',
  'version' => '17.0.2.1',
  'dbname' => '',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => '',
  'dbpassword' => '',
  'mysql.utf8mb4' => true,
  'installed' => true,
  'loglevel' => 3,
  'logtimezone' => 'Europe/Berlin',
  'logdateformat' => 'd.m.y H:i:s',
  'maintenance' => false,
  'secret' => '',
  'ldapIgnoreNamingRules' => false,
  'forcessl' => true,
  'mail_smtpmode' => 'smtp',
  'mail_from_address' => '',
  'mail_domain' => '',
  'mail_smtphost' => '',
  'mail_smtpport' => '25',
  'ldapProviderFactory' => '\\OCA\\User_LDAP\\LDAPProviderFactory',
  'ldapUserCleanupInterval' => 51,
  'lost_password_link' => '',
  'instanceid' => '',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtpname' => '',
  'mail_smtppassword' => '',
  'overwrite.cli.url' => '',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'default_language' => 'de',
  'trashbin_retention_obligation' => 'auto, 60',
  'versions_retention_obligation' => 'auto, 60',
  'theme' => '',
  'simpleSignUpLink' => 'false',
  'activity_expire_days' => '90',
  'default_locale' => 'de',
  'tempdirectory' => '/tmp/nextcloud',
  'default_language' => 'de',
  'default_locale' => 'de',
  'trashbin_retention_obligation' => 'auto, 60',
  'versions_retention_obligation' => 'auto, 60',
  'theme' => '',
  'simpleSignUpLink' => 'false',
  'activity_expire_days' => '90',
);

The output of your nginx log:

[warn] 20163#20163: *49374 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/0/03/0000000030 while reading upstream, client: 212.211.192.4, server: DOMAIN, request: "GET /s/RANDOMCODE/download?path=PATH HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.3-fpm.sock:", host: "DOMAIN", referrer: "https://DOMAIN/s/RANDOMCODE"

nginx vhost:

client_max_body_size 16G;
fastcgi_buffers 64 4K;

fastcgi_request_buffering off;
fastcgi_read_timeout 600s;

proxy_http_version 1.1;
proxy_buffering off;
proxy_buffers 64 128k;
proxy_max_temp_file_size 0;
large_client_header_buffers 16 32k;

php.ini

max_execution_time = 3600
max_input_time = 3600
post_max_size = 16G
upload_max_filesize = 16G