How do I edit the config.php file on a nextcloud box?

Have a look at your trusted_domains with:

sudo nextcloud.occ config:system:get trusted_domains

And add a new trusted_domain with:

sudo nextcloud.occ config:system:set trusted_domains X
--value=subdomain.example.com

As X use (amount of trusted_domains +1). Have a look here:
https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/occ_command.html#setting-an-array-configuration-value

2 Likes