Web and application redirects to local IP

Every time I leave nexcloud on the web platform, it redirects to the local IP of the application on this path: http://192.168.0.22/index.php/logout?requesttoken=WA4M1F7AGcUmxmTq7COnrChRJzM7X6jTSX8KPG2u3Gs%3D%3AbUBagDqEWK4QnCmCg2WXnUtiEFVMPcb4AipTUBTAuw0%3D

When I use the desktop application I can not access because it directs the login to local IP.

I have already made the change in the following path including my public domain: vim /var/snap/nextcloud/current/nextcloud/config/config.php

‘trusted_domains’ =>
array (
0 => ‘192.168.0.22’,
1 => ‘mydomain.com’,
),
‘datadirectory’ => ‘/ var / snap / nextcloud / common / nextcloud / data’
‘dbtype’ => ‘mysql’,
‘version’ => '15 .0.5.3 ',
‘overwrite.cli.url’ => ‘http://mydomain.com’,
‘dbname’ => ‘nextcloud’,

How do I forward to my public domain and not to the IP of my local network ???