"Access through untrusted domain" but I've added it to 'trusted_domains'

The issue you are facing:
I have installed Nextcloud and Nginx on Docker. When I try to access by a local connection (192.168.x.x) it works; I’m using special ports to refer Nextcloud, called A (for non-secured access, refers to internal port 80) and B (to internal port 443). But when I try to connect using my public domain name, it doesn’t work: “Access through untrusted domain”. In fact, I’ve added that domain name in config.php as follows, but it still doesn’t work. Is it a matter of certificates?

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

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

$CONFIG = array (
  'memcache.local' => '\OC\Memcache\APCu',
  'datadirectory' => '/data',
  'trusted_domains' =>
  	array (
    	  0 => '',
    	  1 => 'domain.name.org',
	  2 => '',

I would recommend to use the search function of this forum first, because this question is asked at least once per week :wink: