Nextcloud, HTTPS wrong redirection

If the Nextcloud app is installed without a certificate, everything works fine. However, if the app is installed with the same settings and a certificate, the browser constantly redirects to the TrueNAS dashboard page. What is the reason for this?

Nextcloud App, Certificate ID:

  • No Certificate
  • ‘truenas_default’ Certificate

HTTP, No Certificate, everything OK
http://172.19.50.54:30027 => redirect to => http://172.19.50.54:30027/login

http://172.19.50.54:30027/login => stays on website => http://172.19.50.54:30027/login

HTTPS, ‘truenas_default’ Certificate, wrong redirection
https://172.19.50.54:30027 => redirect to => https://172.19.50.54/ui/sessions/signin

https://172.19.50.54:30027/login => redirect to => https://172.19.50.54/ui/sessions/signin

System Information
Platform: Generic
Version: ElectricEel-24.10.1

Nextcloud
App Version: 30.0.4
Version: 1.5.13

Problem Solved

When installing the Nextcloud app:

  1. Leave the “Host” field empty.
  2. Set the “Certificate ID” to “truenas_default Certificate”.

After installation:

  1. Navigate to the configuration folder of Nextcloud (“Host Path Configuration”).
  2. Go to the “config” subfolder.
  3. Edit the “config.php” file (use sudo nano config.php).
  4. Add the following line, replacing YOUR_IP and YOUR_PORT with your specific IP and port:
'overwritehost' => 'YOUR_IP:YOUR_PORT',
  1. Add your IP to the ‘trusted_domains’ array. The modified section will look like this:
'trusted_domains' => 
array (
  0 => '127.0.0.1',
  1 => 'localhost',
  2 => 'nextcloud',
  3 => 'YOUR_IP',
),

I’m having the exact same issue. For me this did not fix it.
Where exactly did you enter the ‘overwritehost’ part in the config.php file? No matter where I put the phrase it will not work.

Same issue here.

Hi, here is my config.php. When installing the Nextcloud app leave the “Host” field empty!

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'redis',
    'password' => 'xxxxxxxxxx',
    'port' => 6379,
  ),
  'overwriteprotocol' => 'https',
  'trusted_proxies' => 
  array (
    0 => '127.0.0.1',
    1 => '172.19.0.0/16',
    2 => '172.16.0.0/12',
    3 => '10.0.0.0/8',
  ),
  'upgrade.disable-web' => true,
  'passwordsalt' => 'xxxxxxxxxx',
  'secret' => 'xxxxxxxxxx',
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'pgsql',
  'version' => '30.0.5.1',
  'overwritehost' => '172.19.50.54:30027',
  'overwrite.cli.url' => 'https://172.19.50.54:30027',
  'dbname' => 'nextcloud',
  'dbhost' => 'postgres:5432',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_admin',
  'dbpassword' => 'xxxxxxxxxx',
  'installed' => true,
  'instanceid' => 'xxxxxxxxxx',
  'trusted_domains' => 
  array (
    0 => '127.0.0.1',
    1 => 'localhost',
    2 => 'nextcloud',
    3 => '172.19.50.54',	
  ),
);