Empty WebDav Folder only from external connections

Nextcloud version (eg, 12.0.2): 29.0.3
Operating system and version (eg, Ubuntu 17.04): Debian Server 11
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.59
PHP version (eg, 7.1): PHP 8.2.10

The issue you are facing:

If I use WebDav from a Windows Client (es. windows 11) from external connection, I see an empty directory and I can’t write files but if I use an internal connection I could see files.
This is not a network problem as the problem does not occur with another nextcloud instance hosted on the same server.

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

Steps to replicate it:

  1. Connecting a client via webdav from an external (public) connection
  2. See empty folder
  3. By connecting to any internal network (as long as it is private) the problem does not arise

The output of your Nextcloud log in Admin > Logging:

no error logs related to webdav error

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

<?php
$CONFIG = array (
  'instanceid' => '*****',
  'passwordsalt' => '*****',
  'secret' => '*****',
  'trusted_domains' =>
  array (
    0 => '*****',
    1 => '*****',
  ),
  'datadirectory' => '/****/nc2_data',
  'dbtype' => 'mysql',
  'version' => '29.0.3.4',
  'overwrite.cli.url' => 'https://****',
  'dbname' => '******',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => '*****',
  'dbpassword' => '*****',
  'installed' => true,
  'mail_domain' => '*****',
  'mail_from_address' => '**',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_smtphost' => '*****',
  'mail_smtpport' => '25',
  'activity_expire_days' => 14,
  'auth.bruteforce.protection.enabled' => true,
  'blacklisted_files' =>
  array (
    0 => '.htaccess',
    1 => 'Thumbs.db',
    2 => 'thumbs.db',
  ),
  'cron_log' => true,
  'enable_previews' => true,
  'enabledPreviewProviders' =>
  array (
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\GIF',
    3 => 'OC\\Preview\\BMP',
    4 => 'OC\\Preview\\XBitmap',
    5 => 'OC\\Preview\\Movie',
    6 => 'OC\\Preview\\PDF',
    7 => 'OC\\Preview\\MP3',
    8 => 'OC\\Preview\\TXT',
    9 => 'OC\\Preview\\MarkDown',
  ),
  'filesystem_check_changes' => 0,
  'filelocking.enabled' => 'true',
  'htaccess.RewriteBase' => '/',
  'integrity.check.disabled' => false,
  'knowledgebaseenabled' => false,
  'logfile' => '/****/nc2_data/nextcloud.log',
  'loglevel' => 2,
  'logtimezone' => 'Europe/Rome',
  'default_phone_region' => 'IT',
  'log_rotate_size' => 104857600,
  'maintenance' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'overwriteprotocol' => 'https',
  'preview_max_x' => 1024,
  'preview_max_y' => 768,
  'preview_max_scale_factor' => 1,
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),
  'quota_include_external_storage' => false,
  'share_folder' => '/Shares',
  'skeletondirectory' => '',
  'theme' => '',
  'trashbin_retention_obligation' => 'auto, 7',
  'updater.release.channel' => 'stable',
  'lost_password_link' => 'disabled',
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' =>
  array (
  ),
  'twofactor_enforced_excluded_groups' =>
  array (
  ),
  'simpleSignUpLink.shown' => false,
  'mysql.utf8mb4' => true,
  'app_install_overwrite' =>
  array (
    0 => 'apporder',
    1 => 'occweb',
    2 => 'spreed',
    3 => 'ransomware_protection',
  ),
  'maintenance_window_start' => 1,
);

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

192.168.95.94 - - [08/Jul/2024:08:08:04 +0200] “OPTIONS /remote.php/dav/files/testutente HTTP/1.1” 401 5367 “-” “Microsoft-WebDAV-MiniRedir/10.0.22631”
192.168.95.94 - - [08/Jul/2024:08:08:04 +0200] “OPTIONS /remote.php/dav/files/testutente HTTP/1.1” 401 1265 “-” “Microsoft-WebDAV-MiniRedir/10.0.22631”
192.168.95.94 - - [08/Jul/2024:08:08:05 +0200] “OPTIONS /remote.php/dav/files/testutente HTTP/1.1” 401 1265 “-” “Microsoft-WebDAV-MiniRedir/10.0.22631”
192.168.95.94 - - [08/Jul/2024:08:08:06 +0200] “OPTIONS /remote.php/dav/files/testutente HTTP/1.1” 401 1265 “-” “Microsoft-WebDAV-MiniRedir/10.0.22631”
151.47.106.147 - - [08/Jul/2024:08:10:20 +0200] “OPTIONS /remote.php/dav/files/testutente HTTP/1.1” 401 5366 “-” “Microsoft-WebDAV-MiniRedir/10.0.22631”
151.47.106.147 - - [08/Jul/2024:08:10:20 +0200] “OPTIONS /remote.php/dav/files/testutente HTTP/1.1” 401 1265 “-” “Microsoft-WebDAV-MiniRedir/10.0.22631”
151.47.106.147 - - [08/Jul/2024:08:10:22 +0200] “OPTIONS /remote.php/dav/files/testutente HTTP/1.1” 401 1265 “-” “Microsoft-WebDAV-MiniRedir/10.0.22631”
151.47.106.147 - - [08/Jul/2024:08:10:23 +0200] “OPTIONS /remote.php/dav/files/testutente HTTP/1.1” 401 1265 “-” “Microsoft-WebDAV-MiniRedir/10.0.22631”

External connection

Internal connection

What do you mean by an “internal connection”?

Do you have two distinct URLs for your Nextcloud instance? Is that what you mean?

By internal connection I mean coming from private classes such as 192.168.2.0/24 connected within our infrastructure (we are a cloud provider), the URL is the same as it is managed via internal and public DNS. When connections to the same URL, same user, same folders are made from public addresses (external to our infrastructure) we have problems viewing the files and carrying out any operation in webdav. This is not a network issue because another nextcloud instance hosted on the same server does not have this issue. Nextcloud does not generate logs related to these difficulties.

So the underlying IP address or the HTTPS termination point is different, correct?

What’s different about the HTTPS termination points?

Hi,
if I access from within the infrastructure using my internal DNS then I reach the nextcloud instance via the dns address https://n2.dominio.it/ which is resolved into the private IP address of the server 192.168.2.55. If, however, they are outside the infrastructure, public DNS are used (e.g. 8.8.8.8) and therefore the DNS address https://n2.dominio.it/ is resolved with the public address of the firewall which carries out a PAT towards the private address of the server (always 192.168.2.55). So the server has a single IP address, a single SSL certificate and a single Apache2 webserver