Hi
So I have been struggling for a few days now getting swag+nextcloud to work through docker on my Pi4 on my own domain. I wan’t to have nextcloud on a subdomain like nextcloud.domain.com
but I keep getting ERR_CONNECTION_CLOSED no matter what settings I try in the different files and my router+DNS settings. I can do it just fine with letsencrypt+nginx-proxy using the official nextcloud docker container, but I want to use SWAG to be able to combine more easily with other linuxserver docker images, and, because it’s swag. I have been following the guide here SWAG setup - LinuxServer.io
and used a very similar docker-compose.yml file (through portainer, but probably irrelevant), but just with cloudflare dns verification and everything adjusted to my own domain like this:
- URL=mydomain.com
- SUBDOMAINS=wildcard
- ONLY_SUBDOMAINS=false
- VALIDATION=dns
- DNSPLUGIN=cloudflare
- EMAIL=my@email.com
My DNS settings on cloudflare only has two entries, an A entry with mydomain.com
as name and my server IP as content, the other one a CNAME with * as name and mydomain.com
as content. Both as DNS ONLY.
Looking at the logs for all 3 containers it looks fine after the small configurations mentioned in the docs. After the first run I enter my cloudflare email and key in the cloudflare.ini file, and then rename the /config/nginx/proxy-confs/nextcloud.subdomain.conf.sample file by removing the suffix .sample, and then restart swag. I can then access the swag intro page on the local network by going to its IP in the browser, but heading to nextcloud.mydomain.com
I get ERR_CONNECTION_CLOSED
. I then try to fiddle with the settings in the /config/www/nextcloud/config/config.php
file adding the lines indicated:
'trusted_proxies' => ['swag'],
'overwrite.cli.url' => 'https://nextcloud.mydomain.com/',
'overwritehost' => 'nextcloud.mydomain.com',
'overwriteprotocol' => 'https',
and also add to the array ‘trusted_domains’:
array (
0 => '192.168.0.4',
1 => 'nextcloud.mydomain.com',
2 => 'mydomain.com'
),
Restart swag, results the same. I even tried adding *.* to the trusted_domains array, no difference. I have forwarded port 443 and 80 to the server IP on the router, but I don’t suspect the router is where the issues are since I obtain a certificate. But I tried setting a DMZ to the server to expose it completely and see if that made a difference. My ISP router is in bridge mode to a better ASUS router, but again, I think the problems are in the configuration of swag+nextcloud.
What am I doing wrong? Let me know if you need more information, I can send the contents of the conf files etc. This text will be hidden