When accessing the nextcloud of the server on other machines, the following information is prompted:
access through an untrusted domain name, please contact your administrator. If you are an administrator, edit the "trusted_domains" setting in config/config.php following the example in config.sample.php.
Please refer to the documentation for details on configuring this.
Solution:
# vim /var/www/html/config/config.php
<?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' => 'oc4wubc7qjyh',
'passwordsalt' => 'RaTowuwdfG+/tcfdss/xxG7Wou8fdsdfsfd',
'secret' => 'iNlrd92+A6mtpR2aDjZWp8/bOHhjoOyI+wsdfsdfW2+wDXdVH8',
'trusted_domains' =>
array (
0 => '192.168.xx.xx', ## IP地址 修改这里
1 => 'serverl.example.com', ## 域名
2 => '192.168.xx.xx', ## IP地址
3 => '[fe80::xx:xx]',
),
'datadirectory' => '/var/www/html/data',
'dbtype' => 'mysql',
'version' => '20.0.1.1',
'overwrite.cli.url' => 'http://www.xxx.com',
'dbname' => 'nextcloud',
'dbhost' => '192.168.xx.xx:13306',
'dbport' => '',
'dbtableprefix' => 'oc_',
'dbuser' => 'oc_admin',
'dbpassword' => 'AEiu0RlUxxxeff9mF9vV0wTvdqSoj83',
'installed' => true,
);