Need Help with "untrusted domain" setup

    • I already have a dedicated Nginx Proxy-Manager-running for all my installations on a docker.
    • I installed Nextcloud using docker compose on an Openmediavault hosted docker.
    • I set up a “https” proxy on the dedicated Nginx Proxy-Manager forwarded to my Nextcloud install.
    • When I tried to access it with the setup proxy/domain I set up cloud.mydomain.com, it gives me the following errors:
      “Access through untrusted domain
      Please contact your administrator. If you are an administrator, edit the “trusted_domains” setting in config/config.php like the example in config.sample.php.”

Can anyone guide me on how to edit the config/config.php and what exact parameters I should put to get it to work?

Hello @millaw,

welcome to the community.

Please use the search function next time before opening a topic.
You are requesting help and there is the most popular topic in our forums to help you.

Please see:

Thanks for your response.
I did search the forum before asking the question as the answers provided did not address a situation when one already has own Nginx Proxy-Manager on a dedicated machine which provides an https proxy.

The specific proxy is irrelevant. The trusted domains in Nextcloud must be set correctly for any proxy or no proxy.

It’s a security feature to help prevent spoofing. The SNI must match a name that the server is expecting to see.

Part of the reason so many people have issues with trusted domains right after setup is because some of the guides out there put the cart before the horse and have people run through the initial setup wizard by the IP address. This records the IP address as the sole trusted domain. Then they set up DNS later and suddenly it doesn’t work.

1 Like

Thanks for clarifying a little bit more. Here’s the weird and confusing thing.
As explained on the referenced post by @rakeknlven above:

  1. I have added cloud.mydomain.xx to my trusted domain and can access it with local IP and the domain with “https” from Safari and Tor enabled Firefox only.
  2. Any attempt from other browsers has it stuck on spinning after adding my credentials.
  3. Same spinning issues as well using the Nextcloud app on iPhone while using the domain + https, but same iPhone can access it with Safari browser.

Can you access it directly without nginx to see if that’s the issue?

@KarlF12, I can access it directly without ngnix from all browsers, but as soon as I enable ngnix, the restriction kicks in and only Safari can access it.
Not even the Nextcloud app on phone could access it with the domain name, but can access it with the local IP

Okay. That’s going to be something wrong in nginx then. I use Apache so I don’t know if I can offer any advice on it.

You have already helped me a lot by taking the time to respond. Thanks a lot for that.
I guess I’ll install another instance of Nginx Proxy Manager and momentary forward port 443 & 80 to the new installation to see what it gives.

Nextcloud is looking at the site name that was requested to see if it matches one in the trusted_domains. Maybe nginx is not passing the name along?

You could look at Nextcloud’s Apache log to see what request is being sent to it. Maybe that will reveal something helpful.

Also note that there is also a trusted proxy list that needs the reverse proxy’s IP, but that should give you a different error.

I had same problem but different scenario. I have a reverse proxy server accepts url to download files from nextcloud. I got Access through untrusted domain error.
I solved problem by removing X-Forwarded-Host and X-Forwarded-For tags in nginx.conf file like below;

   location ~ xxx/(.*) {
        proxy_pass         http://NEXTCLOUD_HOSTNAME:PORT/remote.php/dav/files/$1;
   }

I didnt add any trusted domains into config.php. And my nextcloud is installed on different IP then Proxy Server IP