Nethserver Nextcloud behind a reverse proxy

NethServer Version: 7.7

I have a NS NC install behind a NS reverse proxy.

Now, an msg in the admin ui states that a config setting should be set for a trusted proxy.
https://docs.nextcloud.com/server/17/admin_manual/configuration_server/reverse_proxy_configuration.html
Having reviewed the NS admin and dev docs, I’m not sure how to do this the NS way, or if it’s really necessary, in fact I’ve yet to find the config/config.php as described by the NC doc, it seems those parameteres are being set by the NS config command.

Also, what’s the general thought behind using a virtual host for NC in NS? My installs are default NS installs, non virtual host.

To get rid of the error you need to append following entries to the config array in config/config.php.
In this example 192.168.1.1 is the reverse proxy server.

  'trusted_proxies'   => ['192.168.1.1'],
  'overwritehost'     => 'domain.tld',
  'overwritewebroot'  => '/nextcloud',

If you like to use a subdomain for instance. I think it’s not necessary in your case because you manage the used hostnames on the reverse proxy server.

http://docs.nethserver.org/en/v7/nextcloud.html#custom-virtual-host

1 Like

Why the brackets around the ip? It doesn’t match any of the current syntax in the config.

To have the possibility to define more proxies. It’s an array.

Source

https://docs.nextcloud.com/server/17/admin_manual/configuration_server/reverse_proxy_configuration.html#multiple-domains-reverse-ssl-proxy

Ah, so I don’t need them unless I have more than one.

Also, my config uses ( ) for arrays.

Yeah, wth? Looking at their example for trusted domains is different than their example for trusted proxies @mrmarkuz

'trusted_domains' =>
  array (
    'demo.example.org',
    'otherdomain.example.org',
  ),

weird.

1 Like

Seems both syntax is correct.

Nextcloud docs:

https://docs.nextcloud.com/server/17/admin_manual/configuration_server/reverse_proxy_configuration.html#multiple-domains-reverse-ssl-proxy

1 Like