Hi everyone,
I’m trying for a long time to get nextcloud working behind a reverse proxy. I have a 502 Bad Getway Error everytime
Quick infos:
My nextcloud is in a VM (192.168.0.22) and the proxy is in a docker in an other device (host 192.168.0.17, docker 172.18.0.2, deployed with portainer). I read many articles, tired many confs and it doesn’t work at all :-/ I still have a 502 error. All VM/hosts/etc are under debian 11. Here a my configs (let me know if you need any others).
Nextcloud apache.conf:
<VirtualHost *:80>
DocumentRoot /var/www/html/nextcloud/
ServerName my.domain
<Directory /var/www/html/nextcloud/>
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews
<IfModule mod_dav.c>
Dav off
</IfModule>
</Directory>
</VirtualHost>
My nextcloud.conf:
<?php
$CONFIG = array (
'htaccess.RewriteBase' => '/',
'memcache.local' => '\\OC\\Memcache\\APCu',
'apps_paths' =>
array (
0 =>
array (
'path' => '/var/www/html/nextcloud/apps',
'url' => '/apps',
'writable' => false,
),
1 =>
array (
'path' => '/var/www/html/nextcloud/custom_apps',
'url' => '/custom_apps',
'writable' => true,
),
),
'instanceid' => 'ocbxfefef457445j31np6mjkjijfiej',
'passwordsalt' => 'hF2m19lxeeJFknJuBfw6jhfRGHMMHajhjuhdzuhuhdz',
'secret' => 'UCKRl9Cc5Uk6gvEkUu85lgiG5kIjeldXKCuJguQt5oE7J4684gehgdsqI',
'trusted_domains' =>
array (
0 => '192.168.0.0/24',
1 => 'my.domain',
2 => '172.18.0.0/22',
3 => '172.18.0.2:80',
),
'trusted_proxies' =>
array (
0 => '192.168.0.0/24',
1 => '172.18.0.0/16',
),
'forwarded_for_headers' =>
array (
0 => 'X-Forwarded-For',
1 => 'HTTP_X_FORWARDED_FOR',
),
'datadirectory' => '/var/www/html/nextcloud/data',
'dbtype' => 'mysql',
'version' => '22.0.0.11',
'dbname' => 'nextcloud',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'someuser',
'dbpassword' => 'mypassword',
'installed' => true,
'overwriteprotocol' => 'https',
'overwrite.cli.url' => 'https://my.domain',
'overwritewebroot' => '/',
'overwritehost' => 'my.domain',
);
My Nginx proxy manager config:
King regards