Problems with caddy and docker with aio

HI,

i try to setup nextcloud AIO with docker and caddy. The server is a linux v-server with docker and AlmaLinux 9.4. Hoster ist strato.

For NC AIO i use the docker-compose file from github without caddy. The caddy container i run with this stack

services:
  caddy:
    image: caddy
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"
    volumes:
      - ./Caddyfile:/opt/containerd/caddy/Caddyfile
      - ./site:/opt/containerd/caddy/srv
      - ./certs:/opt/containerd/caddy/certs
      - ./sites:/opt/containerd/caddy/srv
      - ./data:/opt/containerd/caddy/data
      - ./config:/opt/containerd/caddy/config

The Caddyfile looks like this

https://domain.xxx:443 {
    header Strict-Transport-Security max-age=31536000;
    reverse_proxy ip.4.inter.net:11000
}

The problem what i got is, that i can setup the AIO Containers and the AIO Interface show me that all containers are running. Also i can access the AIO Interface via domain.xxx:8080. But i can not access the Nextcloud website via https://domain.xxx

nc -z ip.4.inter.net 11000; echo $? from inside the caddy container is working is give a 0 back.

The domain.xxx is also hosted at strato but is part of a webhosting packacke and point via A-Record to the IP of the vserver.

I guess there is a problem between caddy and nextcloud - but where to start?

Thanks and Regards

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

What happens when you do so?

1 Like

@szaimen
I try this with the same result. Apache-Port is set to the IP of the server and not to 0.0.0.0

@jtr
This is happen (translate from german):

Website is not reachable

domain.xxx reject the connetion.

Try this:

ERR_CONNECTION_REFUSED

Can you try if 0.0.0.0 works?

Are you sure Caddy is functioning? I’d expect a timeout or something if Caddy can’t reach it’s target behind the scenes, but not an outright connection refused on the front-end. Can you check Caddy’s logs?

- ./Caddyfile:/opt/containerd/caddy/Caddyfile

Also, what’s the deal with these paths? I don’t think the standard Caddy image knows to use /opt/containerd/* [1] but I might be wrong…

[1] https://hub.docker.com/_/caddy

1 Like

Sorry for the late feedback, but the last couple of days i was out for holidays :beach_umbrella:

The tip from jtr was going in the writght way. There were some mismatch for the path. The path /opt/containerd/caddy/.... is the path on the host and not in the container.

In the basic setup i run caddy with a stack setup. Probably there are some wrong configuration from my site for the volumes (just c+p from somewhere on the internet). Today i sort everything out with the correct volumes and voila, everything is running :slight_smile:

Thanks for the point to the write directions

Regards

I changed it today also to 0.0.0.0 and sort my caddy out - so it´s working now.

But i will try it again with the ip of the server, i think this will work also…