[solved] Nextcloud ignoring trusted_domains in config.php file?

Hey guys,

I’ve recently installed Unraid and set up Nextcloud (Linuxserver.io version) + MariaDB from a guide (Installing Nextcloud on Unraid 2022 pt1 - YouTube). I stopped the guide at about 9:30, as I don’t want to connect Nextcloud to a domain (yet), but instead to my Tailscale network. I tested Nextcloud on my local network, and it works great. Yay! I then installed the Tailscale container, authenticated, and set the container so I will never have to login again in the Tailscale UI.

I then tried to access Nextcloud from [unraid_tailscale_IP]:444, which resulted in the predicable error “Access through untrusted domain.” Easy fix, right? I navigated to Nextcloud’s config.php file, and added Nextcloud’s Tailscale IP address to the trusted_domains section of that file. Then, I restarted both Nextcloud and MariaDB. Same error when trying to access Nextcloud from its Tailscale IP address, Nextcloud still works fine on my local network.

I then tried setting up Tailscale MagicDNS, and added that domain to my Nextcloud config.php. (I did check–this file is persistent across container restarts.) I couldn’t access Nextcloud from unraid:444 either. I even tried rebooting my Unraid server. This is what that part of the file looks like now:

array (
0 => ‘192.168.199.2’,
1 => ‘tailscale_IP:444’,
2 => ‘unraid:444’,
),

What am I doing wrong? Here are four other bits of information:

  1. Linuxserver.io is issuing the Nextcloud container a “dummy cert” (for lack of a better term), which causes a bypassable error when I connect over my local network. Is this interfering when I try to connect over the Tailscale network (as I can only connect to Nextcloud over HTTPS on port 444)?
  2. I have a Firewalla Blue intercepting all traffic on my Network before it goes through the main router (that’s why my server’s IP address is .199.2). No traffic from my server has been blocked, however.
  3. I can access Photoprism just fine over the Tailscale network, either at tailscale_IP:2342 or unraid:2342
  4. Why is the trusted IP address over the local network 192.168.199.2? The server’s reserved IP address on my home network is 192.168.199.184. Nothing on my home network has the IP address 192.168.199.2!

Any ideas you guys have would be great. Thank you so much in advance!
Here’s a screenshot of the error message:

  • Distribution & Version (Unraid 6.9.2 - trial)
  • Kernel information (5.10)

The above error was not fixed by me modifying the config.php file because I was modifying the example config file located in /config, and not modifying the real file! In reality, those files reside in a much more buried folder, as I would have known if I had finished the SpaceInvaderOne tutorial.

I didn’t know that, however, so I finally did decided to restart the tutorial and follow it all the way through connecting my server to my domain after all.

Once I modified the correct config file to connect Nextcloud to my domain, however, I kept getting an internal server error when I tried to connect to Nextcloud from it. This baffled me, as I was certain I had setup port-forwarding correctly on the router and followed instructions to the letter! I finally realized that I needed to set my router to forward port 443 to the Firewalla Blue Plus, and then set the Firewalla Blue Plus to forward port 443 to port 444 on my Unraid server (444 because 443 was already in use for the Unraid GUI). This was necessary because the Firewalla Blue Plus automatically moves all devices on my network onto a subnetwork, which it then controls. So, the port on the router was open, but all traffic on it was being intercepted by Firewalla. And since Firewalla had not been set to forward port 443 to a device on its subnet, it blocked the connection.

Nevertheless, all’s well that ends well, and, at long last, I now have a functional Nextcloud instance connected to and accessible by my domain!