Nextcloud Config.php Edited (still untrusted)

I’ve been running into wall for a while now getting my nextcloud instance back up. I gave up recovering my original one for starting over fresh. That proceeded to not work for months. Installation error issues to app never finishing “deploying”.

So now I have finally gotten it to install with a cloudflared tunnel ready, except even after editing the config.php file and restarting the container, I cannot get past the “Access through Untrusted Domain” issue that should be fixed by adding my server’s local IP address to the trusted domains list. I’ve tried adding it as ‘192.168.50.254:30027’, ‘192.168.50.254’, ‘:30027’, ‘domain.com’, ‘subdomain.domain.com’, and seemingly whatever else. I’ve restarted my container after every config.php edit, then click on the “Web UI” button for a fresh tab. I always get the “Access through Untrusted Domain” issue.

1 Like

I don’t have anything to add other than i’m trying to solve the same problem. I’ll post if i find anything.

@NAMoulton Hey, I got this solved today for myself. I’m not using any domains or DNS, but I assume the config.php file will be the same for those.

I had to uninstall Nextcloud from TrueNAS (Electric Eel) and start from scratch but I got it to work. I assume you want to be able to access the Nextcloud server from anywhere so I will explain what I did. It is unintuitive to say the least, especially since the GUI installer doesn’t do a great job explaining what host means for their instance.

Now, basically all you have to do is leave the “Host” box blank in the installation and then add only the server IPs and client IPs to the config.php file manually (no need to include the port number for the config file).

If you only plan to access the Nextcloud instance from the same host IP ie. locally. Then you can input your server IP into the “Host” box in the installation. Otherwise, do everything manually for the trusted domains as I explained above.

I hope this makes sense.

I think this might actually have been the key here. In my experience testing the install (without editing config.php), I was able to get the Host field working to set allowed domains, but only if I set it right on initial install. If I tried to edit it the field, I was not able to get nextcloud to respond to the updated configuration, but when I reinstalled with the correct FQDN it worked. The Host field on my install says my.domain.com:30027 and Nextcloud is allowing that as a trusted domain.

There may be a nextcloud command to clear and repopulate trusted domains without reinstalling, but I don’t know it.

So I’ve rebuilt my Nextcloud, and managed to get Nextcloud to work with my Cloudflare tunnel. But every time I try to access Nextcloud locally it just sends me to the TrueNAS login splash page instead.

I have the local IP and domain in the config.php.

When I add the port nunber to the IP it sends me to the “untrusted domain” splash page again.

Hello, For the last few days, I’ve had nextcloud installed and working with my duckdns domain name. Then today I updated to the last version 1.5.3 and now the APP is running, but I can’t connect with the webui button (ERR_CONNECTION_REFUSED) … so I followed your lead and re-installed, again, the APP is running OK, but now, when I connect, I get the “untrusted domain” splash page. I would like to edit the PHP.config file, I have done this in the past with TN Core, but I am a bit new to Scale and don’t know how to do this … Can someone please explain how I can edit this file? Thanks

Yeah, just click the nextcloud app and look at this list of containers. Should see one called nextcloud and click the shell button. That’ll launch the terminal thingy. I have to do the “apt-get update && apt-get install -y vim” everytime I restart the app. Vim is just the config editor I’m familiar with. Then you just “vim config/config.php” and arrow key to where you want to edit. Press “I” ( <-this sounds like “eye” haha). Then match the format to your IP. Press ESC to stopped editing the text. Then press “:wq” to save & quit. Then just restart the app.

Excellent, thank you very much. I opened PHP.ini and found that my domain:30027 (that I added in APP host section) was indeed listed. So I added a line for local IP:30027 (I figured this wouldn’t hurt).
so now, after resteting the APP, if I use the WEBUI button in the APP screen, it keeps going back to :9001 and fails, but if I use my domain name:30027 in my Chrome browser it works … but my desktop APP is unable to connect (also keeps going back to :9001).
The PHP.ini file , it does show this line towards the top:‘overwritehost’ => xxx:9001 (see attached picture). Also the :9001 adress is listed as trusted domain.
I am tempted to remove these line, but I also assume they are there for a reason !!

Any thoughts??

After further investigation, I found that this ‘overwritehost’ statment is indeed causing problems to others (Running Nextcloud on HTTPS mode behind a Reverse Proxy) and that it could be changed in the APP UI configuration page in the Enviromental variables section. I was able to connect sucessfully with the following config:

Nextcloud config in Truenas:

Host: blank

Enviromental variables :

OVERWRITEHOST
my domain :30027

OVERWRITECLIURL
http://my domain:30027 (I’m not sure what this does, I’ll try to remove it)

Web Port:
30027

Certificate:
‘truenas_default’ Certificate