Sync upload "completes" but file size is 0 or only partially uploaded on server

Nextcloud version (eg, 20.0.5): 25.0.4 (I realize I have an update to do)
Operating system and version (eg, Ubuntu 20.04): UNRAID v6.11.5
Apache or nginx version (eg, Apache 2.4.25): nginx/1.22.1
PHP version (eg, 7.4): PHP 8.1.18

The issue you are facing:
Large files synced from a MacOS client appear to have synced successfully, but they’re not actually available on the server. They’ll show up as 0 byte or partial files. I thought it may be due to auto-updates happening during sync, but I’ve turned off auto updates so I can guarantee that isn’t the issue. I’ve verified the files are actually partial or 0 byte with du -sh commands.

I have an open github issue about this since Sept 22

Is this the first time you’ve seen this error? (Y/N):
No

Steps to replicate it:

I’m not sure how to replicate this issue. I don’t see anything glaring in the server logs.

The output of your Nextcloud log in Admin > Logging:

Sensitive info, but will DM to NC if needed.

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

<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'datadirectory' => '/data',
  'filesystem_check_changes' => 1,
  'instanceid' => 'XXXXXXXXXX',
  'passwordsalt' => 'XXXXXXXXXXXXXXXXXXXXXXXXXX',
  'secret' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
  'trusted_domains' => 
  array (
    0 => '192.168.0.75:4433',
    1 => 'nextcloud.domain.tld',
  ),
  'default_phone_region' => 'US',
  'dbtype' => 'mysql',
  'version' => '25.0.4.1',
  'dbname' => 'nextcloud',
  'dbhost' => '192.168.0.75:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'XXXXXXXXXXXXX',
  'dbpassword' => 'XXXXXXXXXXXXXXXXXXX',
  'installed' => true,
  'trusted_proxies' => 
  array (
    0 => 'swag',
    1 => '10.42.0.0/16',
    2 => '103.21.244.0/22',
    3 => '103.22.200.0/22',
    4 => '103.31.4.0/22',
    5 => '104.16.0.0/12',
    6 => '108.162.192.0/18',
    7 => '131.0.72.0/22',
    8 => '141.101.64.0/18',
    9 => '162.158.0.0/15',
    10 => '172.64.0.0/13',
    11 => '173.245.48.0/20',
    12 => '188.114.96.0/20',
    13 => '190.93.240.0/20',
    14 => '197.234.240.0/22',
    15 => '198.41.128.0/17',
    16 => '2400:cb00::/32',
    17 => '2606:4700::/32',
    18 => '2803:f800::/32',
    19 => '2405:b500::/32',
    20 => '2405:8100::/32',
    21 => '2c0f:f248::/32',
  ),
  'forwarded_for_headers' => 
  array (
    0 => 'HTTP_CF_CONNECTING_IP',
  ),
  'overwrite.cli.url' => 'https://nextcloud.domain.tld/',
  'overwritehost' => 'nextcloud.domain.tld',
  'overwriteprotocol' => 'https',
  'maintenance' => false,
  'preview_max_memory' => 1024,
  'theme' => '',
  'loglevel' => 2,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'XXXXXXXXXXX',
  'mail_domain' => 'XXXXXXXXXX',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'XXXXXXXXXXXXX',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'XXXXXXXXXXXXXXXX',
  'mail_smtppassword' => 'XXXXXXXXXXXXX',
  'app_install_overwrite' => 
  array (
    0 => 'groupfolders',
    1 => 'external',
    2 => 'theming_customcss',
    3 => 'audioplayer',
  ),
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'activity_use_cached_mountpoints' => true,
  'trashbin_retention_obligation' => '365, auto',
  'versions_retention_obligation' => 'auto, 90',
  'enforce_theme' => 'breezedark',
);

The output of your Apache/nginx/system log in /var/log/____:

#These are errors from trying to grab the partial or 0 byte files

2023/05/10 12:05:46 [error] 279#279: *166399 upstream prematurely closed FastCGI request while reading response header from upstream, client: 172.17.0.1, server: _, request: "GET /remote.php/dav/files/XXXXXXXXX/XXXXXXXX/XXXXXXX/XXXXXXXXXXXXX/C0003.MP4 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "nextcloud.domain.tld"

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

Sensitive info, but will DM to NC if needed.

Can you share the full log entry from Nextcloud for that corresponding transaction in your proxy logs?

Also, You have a LOT of proxies configured. What’s the story there?