Hi to all,
Following the guide linked below, I setup my NextCloud with Swag as the subdomain https://nextcloud.mydns.it/
[How-To] Nextcloud with Letsencrypt using OMV and docker-compose
Unfortunately, I can't access because I obtain alway the "502 Bad Gateway" error.
Here is my configuration, I hope someone can help me...
- Docker for Nextcloud, MariaDB and Swag (reverse proxy)
- DNS CloudFlare
A) NextCloud (docker)
Code
version: "2"
services:
nextcloud:
image: ghcr.io/linuxserver/nextcloud
container_name: nextcloud
environment:
- PUID=1000
- PGID=100
- TZ=Europe/Rome
volumes:
- /srv/dev-disk-by-label-RAID5/appdata/nextcloud/config:/config
- /srv/dev-disk-by-label-RAID5/appdata/nextcloud/data:/data
# ports: # uncomment this and the next line if you want to bypass the proxy
# - 450:443
restart: unless-stopped
Display More
B) Swag (docker)
Code
---
version: "2.1"
services:
swag:
image: ghcr.io/linuxserver/swag
container_name: swag
cap_add:
- NET_ADMIN
environment:
- PUID=1000
- PGID=100
- TZ=Europe/Rome
- URL=binax.it
- SUBDOMAINS=wildcard
- VALIDATION=dns
- DNSPLUGIN=cloudflare
- EMAIL=my@mail.com
volumes:
- /srv/dev-disk-by-label-RAID5/appdata/swag:/config
ports:
- 443:443
- 80:80 #optional
restart: unless-stopped
Display More
C) DNS (Cloudflare)
Type | Name | Content | TTL | Proxy status | ||
---|---|---|---|---|---|---|
A | mydns.it | 123.456.789.012 | Auto | DNS only | ||
CNAME | nextcloud | mydns.it | Auto | DNS only |
D) NextCloud configuration file <config.php>
PHP
<?php
$CONFIG = array (
'memcache.local' => '\\OC\\Memcache\\APCu',
'datadirectory' => '/data',
'trusted_proxies' => ['swag'],
'overwrite.cli.url' => 'https://nextcloud.mydns.it/',
'overwritehost' => 'nextcloud.mydns.it',
'overwriteprotocol' => 'https',
'trusted_domains' => array (
0 => 'nextcloud.mydns.it:443',
1 => 'nextcloud.mydns.it',
),
);
Display More
E) NextCloud subdomain configuration <nextcloud.subdomain.conf>
Code
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name nextcloud.*;
include /config/nginx/ssl.conf;
client_max_body_size 0;
location / {
include /config/nginx/proxy.conf;
resolver 127.0.0.11 valid=30s;
set $upstream_app nextcloud;
set $upstream_port 443;
set $upstream_proto https;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_max_temp_file_size 2048m;
}
}
Display More
Really thank you all in advance.