Nextcloud AIO behind Caddy

Hey I tried multiple Nextcloud instances already and I am still wondering and learning.

I build the whole nextcloud from scratch. Then I found snapd and now I switched to docker desktop.

I can get/had everything running. The only reason I am still fiddeling around is I want to use subdomains.

Therefore I use caddy as reverse proxy. Right now I only play around with rejetto HFS and nextcloud.

For some Information the host is a Windows 10 machine and I installed Docker Desktop. Inside Docker Desktop Caddy is running and worked for HFS (also inside docker). However I am to stupid to get the nextcloud domain to work. I always get HTTP 502 ERROR.

The caddy file looks like this right now

https://nextcloud.trolo.ddnss.de:443 {
  reverse_proxy localhost:11000
}
not right now added but was working:
https://hfs.trolo.ddnss.de:443 {
  reverse_proxy <hfs internal docker container ip>:8080
}

This is the command I used to install Nextcloud AIO

docker run ^
--init ^
--sig-proxy=false ^
--name nextcloud-aio-mastercontainer ^
--restart always ^
--publish 8080:8080 ^
--env APACHE_PORT=11000 ^
--env APACHE_IP_BINDING=0.0.0.0 ^
--env APACHE_ADDITIONAL_NETWORK="" ^
--env SKIP_DOMAIN_VALIDATION=false ^
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config ^
--volume //var/run/docker.sock:/var/run/docker.sock:ro ^
-e NEXTCLOUD_DATADIR="/run/desktop/mnt/host/c/ssd/nextcloud" ^
nextcloud/all-in-one:latest

I am sure I am missing something very basic. Does anyone have an idea?
I also tried the internal ip adresses of the apache and nextcloud aio docker containers in the caddyfile. Nothing but 502 error :frowning:

Hi, can you follow all-in-one/reverse-proxy.md at main · nextcloud/all-in-one · GitHub?

Thanks and yeah I don’t know what I am missing.
I think I need to follow step 1.3 (same server docker container)
iii. Connect the reverse-proxy container to the nextcloud-aio network by specifying it as a secondary (external) network for the reverse proxy container. With this setup also, the reverse proxy can utilize Docker bridge network’s DNS name resolution to access nextcloud at http://nextcloud-aio-apache:$APACHE_PORT .

I don’t really know if I did this or how to do it.

Connect the reverse-proxy container to the nextcloud-aio network by specifying it as a secondary (external) network for the reverse proxy container.

I see. Did you already opened the aio interface at port 8080 and put in your domain as documented?

Yeah sure all containers are up and running. As far I can understand http 502 means caddy has nothing to redirect/connect to. Had the same with HFS until I discovered my mistake.

I put “nextcloud.trolo.ddnss.de” as domain before downloading the containers.

I KNEW IT !!! It is as simple as cmd → docker network connect nextcloud-aio caddy

that was the missing step

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.