I install nextcloud and swag. I can only access nextcloud outside of my local network. Inside my network I got a timeout error.
docker-compose for nextcloud and swag:
version: "2"
services:
nextcloud:
image: linuxserver/nextcloud
container_name: nextcloud
environment:
- PUID=1002 #change PUID if needed
- PGID=100 #change PGID if needed
- TZ=Europe/Lisbon #change Time Zone if needed
volumes:
- /srv/dev-disk-by-label-OS/appdata/nextcloud/config:/config #/srv/dev-disk-by-label-disk1 needs to be adjusted
- /srv/dev-disk-by-label-OS/appdata/nextcloud/data:/data #/srv/dev-disk-by-label-disk1 needs to be adjusted
depends_on:
- mariadb
# ports: # uncomment this and the next line if you want to bypass the proxy
# - 445:443
restart: unless-stopped
mariadb:
image: linuxserver/mariadb
container_name: nextclouddb
environment:
- PUID=1002 #change PUID if needed
- PGID=100 #change PGID if needed
- MYSQL_ROOT_PASSWORD=dbpassword #change password
- TZ=Europe/Lisbon #Change Time Zone if needed
volumes:
- /srv/dev-disk-by-label-OS/appdata/nextclouddb:/config #/srv/dev-disk-by-label-disk1 needs to be adjusted
restart: unless-stopped
swag:
image: linuxserver/swag #swag is the replacement for letsencrypt (see link below)
container_name: swag
cap_add:
- NET_ADMIN
environment:
- PUID=1002 #change PUID if needed
- PGID=100 #change PGID if needed
- TZ=Europe/Lisbon # change Time Zone if needed
- URL=mydomain.duckdns.org #insert your domain name - yourdomain.url
- SUBDOMAINS=www,nextcloud
- VALIDATION=http
- EMAIL=myemail@gmail.com # define email; required to renew certificate
volumes:
- /srv/dev-disk-by-label-OS/appdata/swag:/config #/srv/dev-disk-by-label-disk1 needs to be adjusted
ports:
- 444:443
- 81:80
restart: unless-stopped
I tried to uncomment the line ports on nextcloud configuration as it says that it should be uncommented to bypass proxy but portainer gives me an error saying the port is already bind.
My nextcloud config.php:
root@raspberrypi:/srv/dev-disk-by-label-OS/appdata/nextcloud/config/www/nextcloud/config# cat config.php
<?php
$CONFIG = array (
'memcache.local' => '\\OC\\Memcache\\APCu',
'datadirectory' => '/data',
'trusted_proxies' =>
array (
0 => 'swag',
),
'overwrite.cli.url' => 'https://nextcloud.mydomain.duckdns.org',
'overwritehost' => 'nextcloud.mydomain.duckdns.org',
'overwriteprotocol' => 'https',
'trusted_domains' =>
array (
0 => '192.168.1.108:444',
1 => 'nextcloud.mydomain.duckdns.org',
),
'instanceid' => 'instanceid',
'passwordsalt' => 'passwordsalt',
'secret' => 'secret',
'dbtype' => 'mysql',
'version' => '20.0.3.2',
'dbname' => 'nextcloud',
'dbhost' => 'nextclouddb',
'dbport' => '',
'dbtableprefix' => 'oc_',
'dbuser' => 'oc_dbuser',
'dbpassword' => 'dbpassword',
'installed' => true,
);
I forward port 80 and 443 on my router to port 81 and 444 of my server (RPi4).
From what I read on the last couple of days it looks like my router doesn’t support nat loopback.
I’ve trying to set up a dns server using dnsmasq to route the subdomain inside my local network. During this process there was some configuration that worked but I can’t remember which one so I decided to start over again with external help to make it right.
Is it possible to get some nginx logs to understand if there is some request getting to nginx or not?
Thank you