Nextcloud version (eg, 20.0.5): 22.2.5
Operating system and version (eg, Ubuntu 20.04): Debian 10
Apache or nginx version (eg, Apache 2.4.25): 2.4.38
PHP version (eg, 7.4): 7.3.31
The issue you are facing: When going to the domain I get redirected to the servers local ip even when outside of my network
Is this the first time you’ve seen this error? (Y/N):N
Steps to replicate it:
- Setup nginx reverse proxy on a seperate server
- Have it proxy to nextcloud
- Set overwrite host in nextcloud
Nextcloud config
<?php
$CONFIG = array (
'overwritehost' => 'cloud.example.com',
'passwordsalt' => 'no',
'secret' => 'its a secret',
'trusted_domains' =>
array (
0 => 'localhost',
1 => '192.168.5.158',
2 => 'cloud.example.com'
),
'datadirectory' => '/mnt/sandisk',
'dbtype' => 'mysql',
'version' => '22.2.5.1',
'overwrite.cli.url' => 'https://cloud.example.com',
'dbname' => 'nope',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'still no',
'dbpassword' => 'how about no',
'installed' => true,
'memcache.local' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => '/var/run/redis/redis.sock',
'port' => 0,
'timeout' => 0.0,
),
'filelocking.enabled' => true,
'memcache.locking' => '\\OC\\Memcache\\Redis',
'instanceid' => 'probably should be removed',
'maintenance' => false,
'theme' => '',
'loglevel' => 2,
'updater.secret' => 'stuff',
);
Nginx reverse proxy config file Other server:
server {
listen 80;
server_name cloud.example.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name cloud.example.com;
ssl_certificate /etc/letsencrypt/live/cloud.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/cloud.example.com/privkey.pem;
location / {
proxy_pass http://192.168.5.158:80;
proxy_set_header X-Forwarded-For $remote_addr;
client_max_body_size 50G;
}
}