I’m having a problem adding a new domain to “trusted domains” in the config.php
I’ve added 192.168.178.5 and it works just fine. But when i try to add “cloud” or “cloud.fritz.box” and i want to access the web interface with “cloud/” “cloud.fritz.box/” it says:
Access via an untrusted domain
Please contact your administrator. If you are an administrator, edit the trusted_domains setting in config / config.php. See example in config / config.sample.php.
Translated from german to english. Accessing with 192.168.178.5/ works just fine.
Are you manually editing the file or using occ to add it?
I’ve tried editing it manually with " root@Butlr:/var/lib/docker/volumes/nextcloud-data/_data/config# nano config.php " but that doesnt seem to work.
How do you use the occ/what is occ? I’m still fairly new with docker/nextcloud.
I’ve tried doing " docker exec -u www-data -it Nextcloud /bin/bash " but this doesnt seem to have nano installed and i dont have “sudo” for some reason.
first setup your docker container in this way that config.php is “outside” the container in a save place on your host. you do this by defining a volume -v <host-path>:/var/www/html. that makes your changes to the nextcloud config persistent to docker image updates. also apps and themes are persistent to updates of the docker image. (btw: it’s important to understand the difference between images and container. google and youtube will help you. )
now you could edit <host-path>/config/config.php.
occ is the comand line tool to administer nextcloud. in the docker world you run sudo docker exec --user www-data <nextcloud-docker-id> php occ <occ:command options>
some examples. note: you have to put docker exec --user www-data nextcloud php occ in front of each line. remove '- " … " ’ around each line. {{ … }} are variables in this notation. i think you guess the real values to put in.
note that the value of “trusted domains” in the config.php is an array. you are sure you didn’t made a typo?
@nandurx the command is php the parameter are occ as the php programm to execute and config:system:set trusted_domains 2 --value=cloud as what you want occ to do.
to make this work you have to be in the folder where occ is located (/var/www/html) which is the home directory of the user www-data. that why
@Reiner_Nippes: Hey, so I have figured it out. I just made directory outside on sharedfolder and it worked. (I read somewhere on this forum)
I have another question!!!
Does NGNIX proxy manager and nextcloud has any correlation or with mariaDB? Because I deleted nextcloud database in order to do fresh install as I had to change directory as someone recommended to get access through trusted domain. my NGNIX docker stopped working. I thought container doesn’t have effect with other container.
It happened twice as I tried installing nextcloud twice.
I was using command: DROP DATABASE database name; inside mariaDB.
you can link container. that is to say docker waits till mariadb and redis container are started before starting nextcloud and after that starting nginx and nginx proxy.
also if you stop/update mariadb container nextcloud container could be restarted to reconnect to the database.
so what do you mean by this? of course you can’t reach nextcloud web page anymore. the nextcloud container might chance to a state where it is restarted till it can reconnect to the database.
but the two nginx container should not be affected.
So, just a question: In order for anybody to get nextcloud working, you have to jump through all these hoops and edit these config files? I’m an expert in the command line, but how do other people manage this? This is very basic, because you can’t use nextcloud with just localhost on the server, why isn’t this configurable in the web interface? I think this would stop quite a few less tech savy people from using Nextcloud. Or do I miss some information?
No, you don’t have to. Although in practice you probably can’t avoid using the OCC command or changing something in config.php completly.
In this particular case, however, it would not be necessary to change anything, if you would have a proper DNS setup in your local network. Adding more trusted domains for local IP addresses or internal domain names is only necessary if you have to workaround the lack of internal DNS resolution or NAT reflection. The clean solution here would be to make sure that DNS works properly on the internal network instead of adding the local IP of the server to the trusted domains, which then leads to further problems if you want to share links with external users or use Nextxcloud on devices that sometimes are on the internal network and sometimes outside, such as mobile phones.