I’m attempting to set up nextcloud on a headless server using Snap. I’ve followed the very useful instructions in this blog post:
so I now have nextcloud running on the server. The only problem is that I can’t access the server from my Desktop machine using a browser (see message below).
I can ssh into the server and run nextcloud.occ commands, no problem. I have set up an admin account and moved the data directory to an external SSD, all according to the instructions. I have set the IP of the Desktop machine and my router as trusted domains but quite evidently nextcloud isn’t trusting them when I try to reach the server over htpps.
Any ideas/suggestions would be most welcome.
Access through untrusted domain
Please contact your administrator. If you are an administrator, edit the “trusted_domains” setting in config/config.php like the example in config.sample.php.
since the TLS connection is terminated by your webserver, Nextcloud shouldn’t have anything to do with it. Can you make sure your trusted_domain block in your configuration is properly formatted? It should look like this:
Now you say that you have added the IP of your desktop and router there but that is not what this field is for. The trusted_domains works on the server side. Say, you have a server that has IP 126.96.36.199, and a domain points to it: cloud.mydomain.tld. You want Nextcloud to only respond when accessed through the domain, not via the IP directly - so you add your domain to the trusted_domain list but leave the IP out.
In short: put the IP or domain of your server there, not of your clients.
I really can’t thank you enough. That’s exactly what my config file
looked like. What I hadn’t realised was that I needed to access the
server from OUTSIDE my own LAN. I’ve now added the domains to be trusted
from OUTSIDE my LAN and access it via the internet! it works!