Accessing through an insecure domain, "trusted_domains"

When I try to access nextcloud, it gives me this message.

"Accessing from an insecure domain

Please contact your administrator. If you are the administrator, edit the “trusted_domains” setting in config/config.php as shown in the example in config.sample.php."

I’ve already gone to the “config.php” file, added new accesses to “trusted_domains”, but I still get this error and I can’t open nextcloud.

hey @matheusrtomaz and welcome to the communityforum of NC.

well… as long as you kind of don’t give any information about your installation it’s getting really hard to help you here.

are there any installing/setup-messages left under your admin-account?
how did you install your server? Where?

I’m using it on TrueNAS Scale, I’m a beginner in server settings, and I installed it all with the default settings.
There’s also no specific installation/configuration message, but if you want to know something specific I can look it up for you here.
and thank you for your help.

Here’s a print of the config.php file.
https://acrobat.adobe.com/id/urn:aaid:sc:US:cd952486-eb69-40ca-a4a3-ef91188144f8

ummm ya… it would be better readable if you would copy & paste your config.php here while taking care about all sensitive data being manually removed or overwritten by you.

how have you installed your server? docker? Aio? direct?

do you want to run your server only foryourself without any connection to the net?
I can see that you chose your overwrite.url as kind of localhost. First of all I am not sure that this would work. And second - aere you aware that this means “localhost” from your server? So you might wanna add this internal IP as well to your trusted domains. And trusted should the URL/IP be as well which you would use to access your server.

e.g. my.personal.url (which should be the FQDN of your server, moszt likely)

If you don’t know what I’m talking about … it could happen that you should stay away from running your own NC-instance at home if you’re not ready to lean what it takes to install such a software yourself.
In this case I would recommend either getting yourself a managed online server via a hoster or ty try Nextcloud AiO (all in one) which is prolly the most easy way to setup your NC in a sane and easy way.

The config you’re editing is likely not the actual running config. You need to use occ config:list system to see the fully merged config.

The TrueNAS Scale chart passes in the trusted_domains via the NEXTCLOUD_TRUSTED_DOMAINS environment variable. That will take priority over whatever changes you’re making in config/config.php.

In TrueNAS Scale I believe this is all exposed via the form/questions when setting things up. Specifically the Host / Nextcloud host to create application URLs field.

You may also want to search the TrueNAS forum a bit. The chart/package you’re using provided by TrueNAS so it has its own nuances. Though there are numerous users of it here on this forum as well.

Hopefully the above helps.