How to edit trusted domains in Nextcloud on NS8?

I can confirm that the trusted domains are not updated when reconfiguring Nextcloud.
But I can still access the site, no matter which subdomains I add or change. Did you setup DNS entries for your subdomains pointing to the NS8?

It’s possible to edit Nextcloud config.php to change the trusted domains:

Enter user environment:

runagent -m nextcloud1

Edit config.php using nano:

podman unshare nano $(podman volume inspect nextcloud-app-data --format={{.Mountpoint}})/config/config.php

It’s also possible to use occ, see also Double reverse proxy Nextcloud instance on NS 8 - #2 by mrmarkuz

To get the trusted domains:

occ config:system:get trusted_domains

In my case localhost and a domain are set.

To setup a third entry (the first one is entry 0, so we’re using 2):

occ config:system:set trusted_domains 2 --value=sub.domain.tld

As regards the path /nextcloud I was successful using a HTTP route, see also NethServer 7 migration — NS8 documentation

This way the URL should be rewritten from sub.domain.tld/nextcloud to sub.domain.tld so clients can access both ways.

2 Likes