Nextcloud version : 30.0.1
Operating system and version: TrueNas 24.10
The issue you are facing:
I am using Nextcloud on my TrueNas server with a reverse proxy. The server is running on port 9001 internally, but the reverse proxy runs on 443. The environment variable “OVERWRITECLIURL” to “https://mydomain:443 ” in the TrueNas app configuration menu.
Since I upgraded to TrueNas 24.10 from 24.04 I am being redirected from mydomain:443 to mydomain:9001 when accessing nextcloud. Before the upgrade everything worked fine.
I already tried changing overwritehost to mydomain:443 (currently set to mydomain:9001) in the config.php and in the truenas app configuration menu I tried setting “External Port” to 9001. It was previously set to 443. I also tried running the command occ maintenance:repair and occ maintenance:update:htaccess. Both did not work.
How can I make it so that I am not redirected to mydomain:9001 when accessing nextcloud using mydomain:443?
My config.php:
config.php
<?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' => 'PASSWORD',
'port' => 6379,
),
'overwritehost' => 'mydomain:9001',
'overwriteprotocol' => 'https',
'overwrite.cli.url' => 'https://mydomain:443',
'trusted_proxies' =>
array (
0 => '127.0.0.1',
),
'upgrade.disable-web' => true,
'passwordsalt' => 'PASSWORD',
'secret' => 'SECRET',
'trusted_domains' =>
array (
0 => 'localhost',
1 => '192.168.178.101',
2 => '127.0.0.1',
3 => 'localhost',
4 => 'nextcloudnext',
5 => 'nextcloudnext-*',
),
'datadirectory' => '/var/www/html/data',
'dbtype' => 'pgsql',
'version' => '30.0.1.2',
'dbname' => 'nextcloud',
'dbhost' => 'postgres:5432',
'dbport' => '',
'dbtableprefix' => 'oc_',
'dbuser' => 'oc_admin',
'dbpassword' => 'PASSWORD',
'installed' => true,
'instanceid' => 'INSTANCEID',
'default_phone_region' => 'DE',
'maintenance_window_start' => 2,
'enabledPreviewProviders' =>
array (
0 => 'OC\\Preview\\BMP',
1 => 'OC\\Preview\\GIF',
2 => 'OC\\Preview\\JPEG',
3 => 'OC\\Preview\\Krita',
4 => 'OC\\Preview\\MarkDown',
5 => 'OC\\Preview\\MP3',
6 => 'OC\\Preview\\OpenDocument',
7 => 'OC\\Preview\\PNG',
8 => 'OC\\Preview\\TXT',
9 => 'OC\\Preview\\XBitmap',
10 => 'OC\\Preview\\HEIC',
),
'mail_smtpmode' => 'smtp',
'mail_smtpsecure' => 'ssl',
'mail_sendmailmode' => 'smtp',
'mail_smtphost' => 'smtp.strato.de',
'mail_smtpport' => '465',
'mail_smtpauth' => 1,
'mail_domain' => 'domain',
'mail_from_address' => 'nextcloud',
'mail_smtpname' => 'mail',
'mail_smtppassword' => 'PASSWORD',
'memories.exiftool' => '/var/www/html/custom_apps/memories/bin-ext/exiftool-amd64-glibc',
'memories.vod.path' => '/var/www/html/custom_apps/memories/bin-ext/go-vod-amd64',
'maintenance' => false,
'loglevel' => 2,
'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
);
1 Like
per https://docs.nextcloud.com/server/19/admin_manual/configuration_server/reverse_proxy_configuration.html:
overwritehost
set the hostname of the proxy. You can also specify a port.
which you set to port 9001
I already tried changing overwritehost to mydomain:443, but I am still being redirected to 9001
Hi, was this a truecharts app or how did you install Nextcloud on Truenas Scale? See Exporting TrueCharts SCALE Apps and leaving TrueCharts | TrueCharts Charts
I installed the app through the normal TrueNas App Store. I don’t have any TrueCharts apps installed.
I see. I guess it would either way make more sense to ask your question in a truenas scale forum as the integration is maintained by them afaik
I already tried asking for a solution in the truenas Reddit and nobody there could help me either.
szaimen
November 1, 2024, 10:15am
8
I think this is probably a better place to ask for help on the topic: https://forums.truenas.com/
For anybody who finds this thread and has the same problem as I had:
Change the “certificate ID” in the Truenas Nextcloud config to No Cert.
This fixed the issue for me
system
Closed
November 9, 2024, 10:36am
10
This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.