The Basics
- Nextcloud Server version (e.g., 29.x.x):
- AIO, “Hub 10”
- Operating system and version (e.g., Ubuntu 24.04):
- Raspberry Pi OS latest; but NC is running in Docker
- Reverse proxy and version _(e.g. nginx 1.27.2)
- Caddy, latest
- Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
- AIO Hub in Docker (via Portainer Stack)
Summary of the issue you are facing:
I have Nextcloud installed via the AIO (“Hub 10”), installed as a stack through Portainer. It’s running in reverse proxy mode (via Caddy, which is in a separate container).
It all works totally fine - from OUTSIDE my local network. It does not work INSIDE the local network, either physically or via Wireguard. I’d actually like it (actually NEED it) to work the opposite: NOT work outside the local network/Wireguard, and only work inside.
Using host.my.domain gives the “This site can’t be reached … host.my.domain refused to connect” error in Chrome. Using int.er.nal.ip redirects to host.my.domain in Chrome and gives the same error.
The Caddyfile:
host.my.domain:443 {
reverse_proxy int.er.nal.ip:11000
}
int.er.nal.ip:443 {
reverse_proxy int.er.nal.ip:11000
}
ddns.name.that.domain.is.aliased.to:443 {
reverse_proxy int.er.nal.ip:11000
}
The extra Caddyfile entries beyond the first are my attempts to make it work; none of them changed anything. (And yes I restarted Caddy each time.)
The compose text I fed into Portainer to create the Caddy stack:
services:
caddy:
image: caddy:alpine
restart: unless-stopped
container_name: caddy
ports:
- 80:80
- 443:443
network_mode: "host"
volumes:
- /opt/caddy/Caddyfile:/etc/caddy/Caddyfile
- /opt/caddy/certs:/certs
- /opt/caddy/config:/config
- /opt/caddy/data:/data
The compose text I fed into Portainer to create the AIO master container to begin the installation:
services:
nextcloud:
image: nextcloud/all-in-one:latest
restart: unless-stopped
container_name: nextcloud-aio-mastercontainer
ports:
- "8080:8080"
environment:
- APACHE_PORT=11000
volumes:
- nextcloud_aio_mastercontainer:/mnt/docker-aio-config
- /var/run/docker.sock:/var/run/docker.sock:ro
volumes:
nextcloud_aio_mastercontainer:
name: nextcloud_aio_mastercontainer
host.my.domain, localhost, int.er.nal.ip, and ddnsname.ddnsservice.com are all in trusted_domains in config.php (I added the last two in another attempt to fix this…).
Ideas?