Trusted domains are used by Nextcloud to prevent Host Header Poisoning 2.4k. You need to specify every domain at which your Nextcloud can be accessed.
This means if you have Nextcloud installed at “192.168.0.29” and also want it to be accessible at “cloud.example.com 1.5k” you’d need to modify the trusted_domains
entry in your config/config.php
. The initial config would look like the following:
'trusted_domains' =>
array (
0 => '192.168.0.29',
),
To add a new domain just add new entries by appending a new item to the PHP array:
'trusted_domains' =>
array (
0 => '192.168.0.29',
1 => 'cloud.example.com',
),
If you use an environment where your IP address can change multiple times it is recommended to configure your DNS server in a way to resolve to the IP instead of accessing the IP address manually.
Note: Nextcloud is optimised for usage with just a single domain. It is thus recommended to stay with just one domain instead of using multiple ones.
On Cloudamo, location of config.php file is in cPanel > File manager > public_html > config > config.php