Hey guys. Having some issues with nextcloud/swag setup. Hoping someone can point me in the right direction here. What I am trying to accomplish is to use SSL/Letsencrypt to access my resources ONLY locally. In unraid I've configured swag in bridge0 network which is on my local network.
I created a DNS record of nextcloud.mydomain.com pointing to 10.100.100.4 (SWAG proxy)
Configured the config file for nextcloud as per below
Configured the .conf file in SWAG for nextcloud as per below
When I try to access nextcloud.mydomain.com it gives me a 502 Bad Gateway
When I try to access via the IP of 10.100.100.20:444 it rewrites the url to nextcloud.mydomain.com and I get a bad gateway. Not sure what I'm doing wrong here. Any pointers?
<?php
$CONFIG = array (
'memcache.local' => '\\OC\\Memcache\\APCu',
'datadirectory' => '/data',
'instanceid' => 'ocsdasd21a45',
'passwordsalt' => '##',
'secret' => '##',
'trusted_domains' =>
array (
0 => '10.100.100.20:444',
1 => 'nextcloud.mydomain.com',
),
'trusted_proxies' => ['swag'],
'overwrite.cli.url' => 'https://nextcloud.mydomain.com',
'overwritehost' => 'nextcloud.mydomain.com',
'overwriteprotocol' => 'https',
'dbtype' => 'mysql',
'version' => '20.0.5.2',
'dbname' => 'nextcloud',
'dbhost' => '10.100.100.20:3306',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'nextcloud',
'dbpassword' => 'mypassword',
'installed' => true,
);
---------------------------------------------------
## Version 2020/12/09
# make sure that your dns has a cname set for nextcloud
# assuming this container is called "swag", edit your nextcloud container's config
# located at /config/www/nextcloud/config/config.php and add the following lines before the ");":
# 'trusted_proxies' => ['swag'],
# 'overwrite.cli.url' => 'https://nextcloud.your-domain.com/',
# 'overwritehost' => 'nextcloud.your-domain.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.your-domain.com',
# ),
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name nextcloud.mydomain.com;
include /config/nginx/ssl.conf;
client_max_body_size 0;
location / {
include /config/nginx/proxy.conf;
resolver 127.0.0.11 valid=30s;
proxy_pass https://10.100.100.20:444;
proxy_max_temp_file_size 2048m;
}
}