HowTo: Add a new trusted domain

this answer is pure horror.

with at least some kind of knowledge about security you wouldnt recommend to use a ,blacklist" system! no way around whitelists!!!

I get here but not sure if it is written well :confused:

paste in this file config.php this line

  'trusted_domains' =>

array (
0 => ‘yourip’,
1 => ‘yourdomain.example’,
),

My understanding is:

  1. You normally only add node(s) inside your LAN as trusted. So they can access through HTTP.
  2. When you access through HTTPS - SSL encryption from outside, there is no-need to add trusted domain.

Am I correct? Thanks.

No, please see

https://docs.nextcloud.com/server/20/admin_manual/configuration_server/config_sample_php_parameters.html?highlight=trusted_domains#default-parameters

Ich möchte für trusted_domains die Datei
/snap/nextcloud/current/htdocs/config/config.php
editieren. Beim Speichern der Datei erscheint:
Cannot save file [Dismiss]

Ich bin root und die Datei ist: - rw-r-r root:root config.php

Hello @Helmut52,

welcome to the community of Nextcloud.

Please use the search function next time.
It would have brought you to the following page:

i am using nextcloud 21 un Centos 8. i did run this command below:

[root@nc1 nextcloud]# sudo -u apache php occ config:system:set trusted_domains 2 --value=mydomain.com
System config value trusted_domains => 2 set to string mydomain.com
[root@nc1 nextcloud]# systemctl restart httpd

but still the same error still persist. to verify it, here is the config.php file !

config|428x500

restarted the apache daemon, problem still persist

Hi there, I am new to nextcloud and still trying to learn as much as I can from linux.

Could someone explain how I can edit nextcloud’s config file on unraid? I managed to do it for editing the ports unraid uses by physically plugging in the boot drive to my laptop and editing the config file there, but would this also work to add nextcloud trusted domains?

Thanks in advance!

Yes, but I am sure there are easier ways to do that. Never used unraid myself but please see Terminal Access - Unraid | Docs

1 Like

Does anything need to be added to the trusted domains list in order to allow the Android app client to connect to Nextcloud? I have my FQDN and it works fine for the Windows desktop client and from browsers (on Windows or Android) but I cannot get the Android app to connect via the FQDN.

If the desktop is connected using the exact same name, then it’s already in the list, and doesn’t need to be added.
Seems like something wrong with the Nextcloud app on the device, since the browser seems to work there. Edit: Found your thread where you discuss this problem.

1 Like

To find a file (say, config.php) on linux I use:
sudo find / -name config.php

Newbie here. I was able to find the location of the file with “sudo find / -name config.php”. But I can’t open the nextcloud folder to get to the file (authorization issue i guess). What can I do about it?

Hey , i also need help. I am using ngrok to create a url for my local host. once the url is created i added it to the trusted domain but it is still not working.