Help with trusted domains

trusted_domains
#1

Hi there,

I am running Ubuntu 16.04.4 x64 on DigitalOcean. I’ve successfully setup nextcloud and added my domain ‘example.com’ to my droplet. However, I also want to add ‘www.example.com’ to my trusted domain list. Whenever I try to follow the standard procedure, it seems that I can only choose one of them: either the one without ‘www’ or the one with. Is there a way I can add both of them as trusted domains and get the Let’s Encrypt certificate for both?

Thanks in advance :slight_smile:

#2

Hi,

For a certificates from let’s encrypt for two full qualified domain names for one web server, you need to use the newly announced and just supported wildcard certificates (like *.example.com):

These wildcard certificates are supported with certbot 0.22.0.

Regarding your question about trusted domains: actually you only need to add further trusted domains in the config.php of Nextcloud.

  'trusted_domains' =>
  array (
    0 => 'example.com',
    1 => 'www.example.com',
    2 => 'localhost',
  ),
1 Like
#3

Thank you so much for your help Schmu! You are a great help :slight_smile:

#4

Also, can you please outline the procedure for editing the config.php file? I’m using digitalocean and nextcloud is installed on Ubuntu.

#5

Thank you for the compliment :slight_smile:

Unfortunately I don’t know digitalocean and how you can access your server files. I would assume that you can at least access your config.php file via (S)FTP.
In that case you could do the following:

  • access your server with a (S)FTP client
  • navigate to the nextcloud installation directory (maybe you login directly to that directory)
  • in that nextcloud directory look for the directory “config” and enter that directory
  • there you should see the config.php
  • either edit that file with your ftp client directly if your software allows that or download it
  • either way, make your changes as suggested and save/ re-upload the file
  • reload your website

That should be it.

You don’t have SSH access, right?
With SSH access you could login to your server and edit that file directly on the server with the editors vi or nano (as you prefer).

#6

You are as confused as I was. “trusted_domains” isn’t about domains at all, not in the sense of how you access the nextcloud instance. A better term would be “trusted_name” since what’s looked for is the name of the server instance: cloud.wossname.com or whathaveyou. The point is to defeat header malfeasance so the name of the instance is what’s needed. I expected it to be about the domain that could access it but it doesn’t take domains, not as .wossname.com or as 192.168.0..

Bad form, Nextcloud devs.