I reinstalled NextCloud and Swag in a new OMV/Docker setup and can not figure out why NextCloud throws the 502 error.
I followed the guides available everywhere, copying the Swag nextcloud.subdomain.conf.sample to nextcloud.subdomain.conf and editing the NextCloud config.php file, using a copy from my previous setup as a template.
Swag is working fine, it pulled my wildcard certificate which I'm using for HomeAssistant (homeassistant.xxxxxxxx.duckdns.org). I also want to use it for nextcloud.xxxxxxxduckdns.org, which is what I did in my previous setup. When I attach to the console and ping the NextCloud container it gets a response.
Can't find anything in the NextCloud container logs
Any help, pointing me in the right direction would be appreciated. I spent hours on this already and can't figure it out...
Here is the subdomain.conf :
QuoteDisplay More# located at /config/www/nextcloud/config/config.php and add the following lines before the ");":
# 'trusted_proxies' => ['swag'],
# 'overwrite.cli.url' => 'https://nextcloud.example.com/',
# 'overwritehost' => 'nextcloud.example.com',
# 'overwriteprotocol' => 'https',
#
# Also don't forget to add your domain name to the trusted domains array. It should look somewhat like this:
# array (
# 0 => '192.168.0.1:444', # This line may look different on your setup, don't modify it.
# 1 => 'nextcloud.example.com',
# ),
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name nextcloud.*;
include /config/nginx/ssl.conf;
client_max_body_size 0;
location / {
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $upstream_app nextcloud;
set $upstream_port 443;
set $upstream_proto https;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
# Hide proxy response headers from Nextcloud that conflict with ssl.conf
# Uncomment the Optional additional headers in SWAG's ssl.conf to pass Nextcloud's security scan
proxy_hide_header Referrer-Policy;
proxy_hide_header X-Content-Type-Options;
proxy_hide_header X-Frame-Options;
proxy_hide_header X-XSS-Protection;
# Disable proxy buffering
proxy_buffering off;
}
}
And here the config.php:
QuoteDisplay More<?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,
),
),
'instanceid' => '***************',
'passwordsalt' => '*************************************',
'secret' => '*****************************************************************',
'trusted_domains' =>
array (
0 => '192.168.1.122:8080',
1 => 'nextcloud.xxxxxxx.duckdns.org',
),
'datadirectory' => '/var/www/html/data',
'dbtype' => 'mysql',
'version' => '27.0.2.1',
'overwrite.cli.url' => 'https://nextcloud.xxxxxxx.duckdns.org',
'dbname' => 'nextcloud',
'dbhost' => 'mariadb',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'nextcloud',
'dbpassword' => '******************',
'installed' => true,
'default_phone_region' => 'US',
'trusted_proxies' =>
array (
0 => ['swag'],
),
'overwritehost' => 'nextcloud.xxxxxx.duckdns.org',
'overwriteprotocol' => 'https'
'app_install_overwrite' =>
array (
0 => 'backup',
1 => 'maps',
),
'mail_from_address' => 'xxxxxxxxx',
'mail_smtpmode' => 'smtp',
'mail_sendmailmode' => 'smtp',
'mail_domain' => 'yahoo.com',
'mail_smtphost' => 'smtp.mail.yahoo.com',
'mail_smtpauth' => 1,
'mail_smtpsecure' => 'ssl',
'mail_smtpname' => 'xxxxxxx@yahoo.com',
'mail_smtppassword' => '***************',
'mail_smtpport' => '465',
'loglevel' => 2,
'maintenance' => false,
);