Nextcloud 17.0.1 sync files from Synology CloudStation to Nextcloud login invalidates

I use nextcloud since version 15 on my own homeserver (docker container).
At that time I started to sync my file from a NAS directory using Synology CloudSync with webdav method to Nextcloud. Worked very good.
As I moved to a new server I updated to a new version of nextcloud.
But webdav connected breaks every time after several tiem (about an hour or so).
Sync works during that time. Actually I am on nextcloud 17.0.1.
I use Apache to redirect the external link to the nextcloud docker using a ReverseProxy.
But If I like to sync my file s I have to reauthenticate the CloudSync account to nextcloud.
Very bad.
The error in Synology CloudSync: “The autorization of your public cloud account has been revoked or expired.Please connect to the account again.”

version: ‘2’

    driver: local
      type: none
      o: bind
      device: '/data/nextcloud/data'

    driver: local
      type: none
      o: bind
      device: '/data/nextcloud/mysql'

    image: mariadb
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    restart: always
      - db:/var/lib/mysql
      - MYSQL_ROOT_PASSWORD=<****>
      - MYSQL_PASSWORD=<****>
      - MYSQL_DATABASE=<****>
      - MYSQL_USER=<****>

    image: nextcloud:latest
      - 9080:80
      - MYSQL_HOST=db
      - db
      - nextcloud:/var/www/html
    restart: always

config.php in nextcloud:

$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' => '**bigbrother**',
  'passwordsalt' => '**bigbrother****bigbrother****bigbrother**',
  'secret' => '**bigbrother****bigbrother****bigbrother**',
  'trusted_proxies' => 
  array (
    0 => '',
    1 => '',
  'trusted_domains' => 
  array (
    0 => '**bigbrother**:9080',
    1 => 'fritzvpn.**bigbrother**.com',
    2 => '',
    3 => '',
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'https://vpn.**bigbrother**.com/nextcloud',
  'overwritehost' => '/vpn.**bigbrother**.com',
  'overwriteprotocol' => 'https',
  'overwritewebroot' => '/nextcloud',
  'dbname' => 'nextcloud',
  'dbhost' => 'db:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '**bigbrother**',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'PLAIN',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_smtphost' => '**bigbrother**',
  'mail_smtpport' => '**bigbrother**',
  'mail_smtpauth' => 1,
  'mail_from_address' => 'nextcloud',
  'mail_domain' => '**bigbrother**',
  'mail_smtpname' => '**bigbrother**',
  'mail_smtppassword' => '**bigbrother**',
  'maintenance' => false,
  '' => 'stable',
  'loglevel' => 2,
  'theme' => '',
  'app_install_overwrite' => 
  array (
    0 => 'calendar',
    1 => 'activitylog',
  'updater.secret' => '**bigbrother**',

Just to be sure (as I don’t know the synologie universe), you have an account on Nextcloud where your Synology is logging in? And this login expires?

What changed a bit over the last version regarding the user accounts was the 2-Factor-Authentication and a probably changed session management. For non-human logins, I’d rather use app passwords to login, you can create them on the user’s settings page.

I don’t use two factor authentification.
It does not matter whether I use a normal nextcloud user login or create a specific App login.
Somehow it gets invalid after some time. I also thought it is the trusted_proxies setting as there are some posts led me to add there some more IPs (like external IP from dyndns redirected to nextcloud). But it did not change anything.
Maybe I try to go back to Nextcloud version 15 where everything worked with this configuration.