Contacts are not synchronised "because it violates local access rules"?

Nextcloud version (eg, 20.0.5): 22.2.0
Operating system and version (eg, Ubuntu 20.04): Docker v20.10.3 Container

PHP version (eg, 7.4): 7.4.18

The issue you are facing:

Not all contacts are synchronised.

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

It does not work with the PC client and not with the Android7 client (DAVx5 v4.0).

Steps to replicate it:

  1. I installed Nextcloud 22.2.0 in a Docker v20.10.3-1239 Container (Port forwarding 6080 to 80) on Synology ds420+.
  2. I created address books in Nextcoud and set up CardDAV Sync (with http://IP_OF_NAS:6080) in the PC client. The Nextcloud address books are recognised by the PC client and DAVx5.
  3. I entered contacts with the PC Client and imported an address book (*.vcf).
    3a. Not all contacts are shown in Nextcloud.
  4. I imported an address book (*.vcf) within Nextcloud.
    4a No contacts are shown in the PC-Client.
    BTW: CalDAV Sync with http://IP_OF_NAS:6080 works fine.

The output of your Nextcloud log in Admin > Logging:

[no app in context] Warning: Host IP_OF_NAS was not connected to because it violates local access rules

GET /core/preview?fileId=320&x=32&y=32
from by USER at 2021-11-20T14:36:08+00:00

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

There are several config.php, this one is /volume1/docker/nextcloud/config/config.php

$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
  'instanceid' => 'ocxop5w5h219',
  'passwordsalt' => 'XXX',
  'secret' => 'XXX',
  'trusted_domains' => 
  array (
    0 => 'IP_OF_NAS:6080',
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'http://IP_OF_NAS:6080',
  'dbname' => 'nextcloudDB',
  'dbhost' => 'IP_OF_NAS:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'DBUSER',
  'dbpassword' => 'MARIADB_PASSWORD',
  'installed' => true,