How to add a new trusted domain in Nextcloud?

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

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

Can I personalize my cloud - own design, color, logo ?

Yes, this is possible with all packages. At Nextcloud you have the so-called "Theming" function....

Can I use my own domain ?

You can use your own domain/subdomain at any time with all packages. You can either order one, or...

Can I mount the cloud using Webdav without Sync Client ?

This is possible at any time. Of course, you can also use other synchronizing tools, such as...

Unlimited users/groups and own apps ?

That's right. You can set unlimited user and groups, as well as use all available apps. The only...

How can I erase my cloud and terminate my account ? Right to be Forgotten

You can terminate your service at any time, with only a few clicks in the customer panel at MY...