Owncloud "trusted_domains" configuration

I got my webserver set up with debian 10. I installe a LEMP stack and I’m trying to get owncloud to work.
I used this tutorial:

I was able to install ownCloud from the CLI, but the trusted domain part didn’t work. went to my /var/www/html/owncloud/config/config.php and changed my trusted_domains array by adding:
‘trusted_domains’ =>
array (
0 => ‘localhost’,
1 => ‘127.0.0.1’,
2 => ‘www.10.131.29.222’,
3 => ‘10.131.81.22’,
),

I keep seeing the trusted domain warning on the page even though I made these changes, and won’t let me log in.

“You are accessing the server from an untrusted domain.
Please contact your administrator. If you are an administrator of this instance, configure the “trusted_domains” setting in config/config.php. An example configuration is provided in config/config.sample.php or at the documentation.”

Here’s a copy of my config.php file:

    <?php
$CONFIG = array (
  'instanceid' => 'ocyrjxqcibc3',
  'passwordsalt' => 'zLYwPuCbgGgkBTMq73Ph/oGpzTocYq',
  'secret' => 'R4Dpcijytj7oHqBwN9uk4IPEWthURFoQdfcT56dxb2ONKwZQ',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '127.0.0.1',
    2 => 'www.10.131.29.222',
    3 => '10.131.81.22',
  ),
  'datadirectory' => '/var/www/html/owncloud/data',
  'overwrite.cli.url' => 'http://localhost',
  'dbtype' => 'mysql',
  'version' => '10.6.0.5',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'zzzzz', //these are edited
  'dbpassword' => 'zzzzzz', ///these are edited
  'logtimezone' => 'UTC',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/owncloud/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/owncloud/apps-external',
      'url' => '/apps-external',
      'writable' => true,
    ),
  ),
  'installed' => true,
);

OwnCloud version 10.6.0
PHP version 7.3
nginx version 1.14.2
MariaDB version 10.3.27-MariaDB-0+deb10u1

Thanks in advance for the help

AFAIK localhost is always trusted, no need to insert it here.

I assume this is wrong, it has to be either an IP number or a domain name.

You didn’t mention, which of the domains failed to connect.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.