Help setting up a 2nd Nextcloud instance on same server - nginx

I have a working server with these specs:

Nextcloud 21.0.1
8GB Ram
Ubuntu 20.04.2
PHP 8.0.7
PostgreSQL 13.3
Nginx server

Regular installation using this guide:

I would like to install a 2nd instance of nextcloud on the same server.

I am following a few tutorials starting from the nginx configuration files located in /etc/nginx/conf.d
so i pointed a new domain to the server, and created a .conf file for it with the following:

  GNU nano 4.8                                                   exampledomain.conf                                                              

upstream php-handler {
server unix:/run/php/php8.0-fpm.sock;

server {
listen 80 default_server;
root /var/www/cloud.exampledomain;
location ^~ /.well-known/acme-challenge {
default_type text/plain;
root /var/www/letsencrypt;
location / {
return 301 https://$host$request_uri;

I put just a test index.html file in the new directory, first i am trying to reach the new domain before copying the nextcloud setup files and database, etc

Whats happening is, when i test the new domain, i get an error message: " Access through untrusted domain" from nextcloud.
How do i make it go to the new directory without interfering with the existing nextcloud setup?
Thank you

In order to get rid of that message you need to put an entry for your new host in your nextcloud config.php file (possible /var/www/

it should look something like this:

‘trusted_domains’ =>
array (
0 => ‘’,
1=> ‘’,

I have not tried to run two instances so I have no idea if that will work but this is the entry you need to overcome “untrusted domain”