Hi,
i’m running into some weird problems with a fresh Nextcloud install behind a local Proxy.
So far I have encountered two symptoms which may or may not result from the same problem:
- In the contacts menu on the top right, pictures, names and the “Nextcloud Talk” icons only show up if i visit the Nextcloud via the local IP. If i use the public domain (cloud.example.com) I only see a list of usernames that can’t be interacted with.
- Connecting to the Nextcloud using the app is only possible through the local IP, when I try to log in via the public domain nothing happens after pressing the “Grant Access Button”.
The Setup is the following:
- A public domain with subdomain (cloud.example.com) with a DNS redirect (Type A) to our static IP.
- All traffic that arrives on Port 80 & 443 is redirected to proxy server (192.168.0.109) running Ubuntu Server
- That Proxy Server (109) has a apache2 config file that redirects to the nextcloud server (192.168.0.112) also running Ubuntu Server:
nextcloud.conf on 192.168.0.109
<VirtualHost *:80>
ServerName cloud.example.com
Redirect permanent / https://cloud.example.com
</VirtualHost>
<IfModule mod_ssl.c>
SSLStaplingCache shmcb:/tmp/stapling_cache(128000)
<VirtualHost *:443>
ServerName cloud.example.com
ProxyPreserveHost On
ProxyRequests Off
ProxyPass / http://192.168.0.112/
ProxyPassReverse / http://192.168.0.112/
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/cloud.example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/cloud.example.com/privkey.pem
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
</IfModule>
</VirtualHost>
- The Nextcloud Server (112) has a standard apache2 config file for the nextcloud installation:
nextcloud.conf on 192.168.0.112
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/nextcloud
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
#Nextcloud Konfiguration
<Directory /var/www/html/nextcloud/>
Options +FollowSymlinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/html/nextcloud
SetEnv HTTP_HOME /var/www/html/nextcloud
</Directory>
</VirtualHost>
My Nextcloud System Info:
Nextcloud version: 18.0.2
Operating system and version: Ubuntu Server 19.10
Apache or nginx version: Apache 2.4.41
PHP version: 7.3
In my Nexcloud Log I get a couple of Errors:
imagecreatefromstring(): Data is not in a recognized format at /var/www/html/nextcloud/lib/private/legacy/image.php#621
Swift_TransportException: Connection could not be established with host 127.0.0.1 :stream_socket_client(): unable to connect to 127.0.0.1:25 (Connection refused)
Cannot declare class OCA\Talk\Migration\Version2000Date20170707093535, because the name is already in use at /var/www/html/nextcloud/apps/spreed/lib/Migration/Version2000Date20170707093535.php#127
My Nextcloud config.php file:
<?php
$CONFIG = array (
'instanceid' => 'xxx',
'passwordsalt' => 'xxx',
'secret' => 'xxx',
'trusted_domains' =>
array (
0 => 'cloud.example.com',
1 => '192.168.0.112',
2 => 'localhost',
),
'trusted_proxies' =>
array (
0 => '192.168.0.109',
),
'datadirectory' => '/var/www/html/nextcloud/data',
'dbtype' => 'mysql',
'version' => '18.0.2.2',
'overwrite.cli.url' => 'https://cloud.example.com',
'dbname' => 'nextcloud',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'nextcloud',
'dbpassword' => 'password',
'installed' => true,
);
I’ll be happy for any advice on what might be wrong here and how to set up the reverse Proxy properly.
Thanks in advance!
Jasper