Trusted domains not working properly

Accessing my nextcloud through “192.168.2.230’” works fine.
However i need to be able to access nextcloud though 192.168.2.230:8080/nextcloud/.

When I try to access it through the “192.168.2.230:8080/nextcloud/” address it tells me i have an untrusted domain, even though it has the same domain. I tried trusting several domain variations, but that didnt help.

Additionally in the documentation it says that, allowing one port “disallows all other ports on this host”, which is apparently not true, because i can still access nextcloud via “192.168.2.230”, so Port 80 must still be open.

It’s called Trusted Domains, not Trusted URLs, Trusted Ports or Trusted Subdirectories. :wink:

So I would remove everything from the trusted_domains array except the first entry and play with the overwrite parameters instead: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#overwritehost

Example:

'trusted_domains' => 
  array (
    0 => '192.168.2.230',
),
'overwritehost' => '192.168.2.230:8080',
'overwritewebroot' => '/nextcloud',
3 Likes

I just saw, that it also says…

the IP address with or without permitted port, e.g. [2001:db8::1]:8080 Using TLS certificates where commonName= is deprecated

So if you’re only accessing your Nextcloud via the IP address, using https with self-signed certificates, and probably via plain http as well, I’d guess you can leave out the trusted_domains array altogether.

Also, from your screenshot it looks like Nextcloud is installed in /var/www/html, which is the default webroot of Apache, so I’m a bit supriesed that you can even access your Nextcloud via 192.168.2.230:8080/nextcloud/.

Anyways, if the overwrite parameters don’t work, we need more details about how (web server configuration) and where (the exact path) you have installed Nextcloud in to be able to help you.

1 Like

It sort of sounds like you want to do a directory based installation, but did a VirtualHost installation.

  • Is Nextcloud installed in a directory called /nextcloud underneath your web server’s DocumentRoot
  • Alternatively, are using a reverse proxy in front that is handling the /nextcloud for you?

You’ll have to share more details of your installation, including your install method, web server being used, etc. though for us to be more helpful.

Additionally in the documentation it says that, allowing one port “disallows all other ports on this host”, which is apparently not true, because i can still access nextcloud via “192.168.2.230”, so Port 80 must still be open.

It disallows all ports not specified. But one of your specified values is 192.168.2.230 which is for port 80.

The reason why im doing all of this is, because i only have the port 8080 to work with (i cant change the router settings) and that nextcloud is not the only webpage i need to host. I also have my own domain, but since “my.domain.net/nextcloud/” gave me the same error i figured, that the domain had nothing to do with it.
Regarding your question why i can access nextcloud via “192.168.2.230:8080/nextcloud/”: I have an nginx server at the port 8080 which forwards everything with “/nextcloud/” to the internal docker ip address.

Thanks for the fast reply and your time!