Nextcloud Trusted Domains not working

So, my Nextcloud has been running fine over the year since I set it up. Yesterday I bought a new, second, domain which I also pointed to the IP of my server. I added the second domain to the trusted domain array in config.php with the same syntax as the one that was already listed.

Unfortunately, I still get the trusted domain error when i use the second domain, the first, original one, still works. I tried using wildcards in the array (*) but that did not work. Also, using:

sudo -u www-data php /var/www/nextcloud/occ config:system:set \ trusted_domains 1

did not work.

Does anyone have any clue as to what I could try to do in order for my seconds domain to work? I am using HTTPS (LE) and have setup nice url´s.

Please check file config.php and see if the variables are correct for you.

If you mean by variables, the domain I would like to work, then yes, the variables are correct.

Hi, I might have posted a solution for this problem in an old post, but anyway, here it is

hope it helps