Changing webroot LOCALLY results in ERR_TOO_MANY_REDIRECTS

Hi, I’m fairly new to nextcloud and i think that is an awesome tool.
I was using it for a while through a vpn connection to test it and finally decided to make a stable deployment. I have other services available through subsfers and i was planning to add a /nextcloud to access it.

But when in the config.php file I add ‘overwritewebroot’ => ‘/nextcloud’, which results in ERR_TOO_MANY_REDIRECTS every time. Even if I access it locally at https://192.168.x.x:444/nextcloud/login, the same error shows up. I have read ALL the thread posts that I could find but all of them point to the reverse proxy configuration. It seems to me that this problem is before the reverse proxy.

This is the configuration of NC, thanks in advance.

<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'datadirectory' => '/data',
  'instanceid' => 'ocxcxyfizyhy',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' =>
  array (
    0 => '192.168.x.x:444',
    1 => 'my.domain.com',                                        #---added
  ),
  'dbtype' => 'mysql',
  'version' => '25.0.1.1',
  'overwrite.cli.url' => 'https://192.168.x.x:444',
  'overwriteprotocol' => 'https',                              #---added
  'overwritewebroot'  => '/nextcloud',                   #---added
  'dbname' => 'nextcloud',
  'dbhost' => 'x.x.x.x:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '',
  'dbpassword' => '',
  'installed' => true,
);

Let’s see your web server configs for both the main and the reverse proxy. The problem is going to be in there somewhere, probably not the Nextcloud config.

The reverse proxy is not set yet because I encountered this problem.

The docker container runs inside an unraid server and the error shows up when I try to reach NextCloud locally (https://localip:port/nextcloud).

So what webserver configuration are you referring to ?

That’s why we have the support post template…

So just to recap, you changed the overwritewebroot in the config.php, but you have not actually changed where the web root is inside the container? Then the error is expected.

Overwritewebroot is for use with a reverse proxy when the actual web root may not match the same path where the reverse proxy is providing the site. Without a reverse proxy, setting the path to something it’s not will just break it.

Can you post your reverse proxy config?

This is the configuration of the custom location, i’m using Nginx proxy manager container.

I think you need to replace IP address with the public hostname and add /nextcloud to this parameter as well:

I made many research and modify the config file, and now looks like this:

<?php
$CONFIG = array (
  ...
  'trusted_domains' => 
  array (
    0 => '192.168.9.2:444',
    1 => 'my.domain.com',
  ),
  'dbtype' => 'mysql',
  'version' => '25.0.1.1',
  'dbname' => '',
  'dbhost' => '',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '',
  'dbpassword' => '',
  'installed' => true,
  #
  'overwritewebroot' => '/nextcloud',
  'overwrite.cli.url' => 'https://my.domain.com/nextcloud',
  'trusted_proxies' => ['192.168.x.x'],
  'overwriteprotocol' => 'https',

and even changed my Nginx configuration to this:
(added /nexcloud at the end of the path like suggested under the forward ip)
image

But the TOO_MANY_REDIRECTS error remains either connecting through the domain (https://my.domain.com/nextcloud) or locally (https://localip:444/nextcloud).

If from the config.php the ‘overwritewebroot’ => ‘/nextcloud’ is removed, the dashboard is reachable and working normally at https://localip:444.