Nextcloud app can't access server from WAN, but can from LAN

Nextcloud version (eg, 20.0.5): 21.0.0
Operating system and version (eg, Ubuntu 20.04): docker container in Unraid
Apache or nginx version (eg, Apache 2.4.25): ?
PHP version (eg, 7.4): 7.4.25

The issue you are facing:
I have Nextcloud set up in a docker container on Unraid and I access it through an Apache reverse proxy.

From my LAN, everything works fine. I have my photos set up to auto upload in the Android app, works perfectly. However, when I switch to 4G, the app can’t upload anymore, I receive a timeout warning. I can, however, access the web interface from a browser and upload manually. Not in the app, however, just the web interface.

Is this the first time you’ve seen this error? (Y/N): No, been having this since I switched the install to docker.

It’s as though everything works, except WebDAV remotely.

Steps to replicate it:

  1. Turn off wifi
  2. Make photo
  3. Get error

The output of your Nextcloud log in Admin > Logging:

Absolutely nothing in logging, the app can't even reach the server

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',
  'instanceid' => 'xxxx',
  'passwordsalt' => 'xxxxx',
  'secret' => 'xxxxx',
  'trusted_domains' => 
  array (
    0 => '192.168.2.179:8443',
    1 => 'xxxxxx',
  ),
  'dbtype' => 'mysql',
  'version' => '21.0.0.18',
  'overwrite.cli.url' => 'https://192.168.2.14:8443',
  'installed' => true,
  'maintenance' => false,
  'mysql.utf8mb4' => true,
  'dbname' => 'nextcloud',
  'dbhost' => '192.168.2.132',
  'dbuser' => 'nextcloud',
  'dbpassword' => 'xxxxx',
  'trusted_proxies' => 
  array (
    0 => '192.168.2.132',
  ),
  'overwritehost' => 'xxxxxx',
  'overwriteprotocol' => 'https',
  'default_phone_region' => 'NL',
  'app_install_overwrite' => 
  array (
    0 => 'bruteforcesettings',
  ),
  'filesystem_check_changes' => 1,
);

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

Nothing appears in the logs when I attempt to access through the app on 4G… when I use the web interface, it does.

As soon as I turn on WIFI, this happens:

192.168.2.5 - - [10/Nov/2021:08:56:41 +0100] "GET /index.php/204 HTTP/1.1" 204 0 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.17.1"
192.168.2.5 - arjen [10/Nov/2021:08:56:41 +0100] "PROPFIND /remote.php/webdav/ HTTP/1.1" 207 370 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.17.1"
192.168.2.5 - arjen [10/Nov/2021:08:56:41 +0100] "PROPFIND /remote.php/webdav/pve-rootca.pem HTTP/1.1" 207 888 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.17.1"
192.168.2.5 - arjen [10/Nov/2021:08:56:42 +0100] "PROPFIND /remote.php/webdav/nzb360_backup_2021_07_09.zip HTTP/1.1" 207 893 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.17.1"
192.168.2.5 - arjen [10/Nov/2021:08:56:42 +0100] "PROPFIND /remote.php/webdav/Wallpapers/ HTTP/1.1" 207 381 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.17.1"
192.168.2.5 - arjen [10/Nov/2021:08:56:42 +0100] "PROPFIND /remote.php/webdav/erl%20ovpn/ HTTP/1.1" 207 381 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.17.1"
192.168.2.5 - arjen [10/Nov/2021:08:56:42 +0100] "PROPFIND /remote.php/webdav/Pictures/ HTTP/1.1" 207 379 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.17.1"
192.168.2.5 - arjen [10/Nov/2021:08:56:42 +0100] "PROPFIND /remote.php/webdav/OpenVPN/ HTTP/1.1" 207 378 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.17.1"
192.168.2.5 - arjen [10/Nov/2021:08:56:46 +0100] "HEAD /remote.php/webdav/InstantUpload/Camera/2021/11/IMG_20211110_083134.jpg HTTP/1.1" 200 0 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.17.1"
192.168.2.5 - arjen [10/Nov/2021:08:56:46 +0100] "MKCOL /remote.php/dav/uploads/arjen/c849ddbf35624f73ef429229c38b32c3 HTTP/1.1" 201 0 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.17.1"
192.168.2.5 - arjen [10/Nov/2021:08:56:47 +0100] "PROPFIND /remote.php/dav/uploads/arjen/c849ddbf35624f73ef429229c38b32c3 HTTP/1.1" 207 784 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.17.1"
192.168.2.5 - arjen [10/Nov/2021:08:56:47 +0100] "PUT /remote.php/dav/uploads/arjen/c849ddbf35624f73ef429229c38b32c3/0000000000000000-0000000002047704 HTTP/1.1" 201 0 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.17.1"
192.168.2.5 - arjen [10/Nov/2021:08:56:48 +0100] "MOVE /remote.php/dav/uploads/arjen/c849ddbf35624f73ef429229c38b32c3/.file HTTP/1.1" 204 0 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.17.1"
192.168.2.2 - - [10/Nov/2021:08:56:49 +0100] "GET /apps/logreader/poll?lastReqId=owc8AERdNd70tjacDaQA HTTP/1.1" 200 22 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36"
192.168.2.5 - arjen [10/Nov/2021:08:56:49 +0100] "PROPFIND /remote.php/webdav/InstantUpload/Camera/2021/11/IMG_20211110_083134.jpg HTTP/1.1" 207 917 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.17.1"
192.168.2.5 - arjen [10/Nov/2021:08:56:50 +0100] "GET /index.php/apps/files/api/v1/thumbnail/256/256/InstantUpload/Camera/2021/11/IMG_20211110_083134.jpg HTTP/1.1" 200 12073 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.17.1"