-
Here's a docker-compose that I was able to get working with Caddy: version: "3.8"
services:
caddy:
image: caddy:alpine
restart: unless-stopped
container_name: caddy
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- ./certs:/certs
- ./config:/config
- ./data:/data
- ./sites:/srv
network_mode: "host"
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
depends_on:
- caddy
volumes:
nextcloud_aio_mastercontainer:
name: nextcloud_aio_mastercontainer With this as the https://cloud.domain.com:443 {
header Strict-Transport-Security max-age=31536000;
reverse_proxy localhost:11000
} I think that it'd be a good idea to have a @szaimen Are you open to a PR to add this? |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments 32 replies
-
Hello, I have something different in mind: See #588 |
Beta Was this translation helpful? Give feedback.
-
How would you add other urls to the Caddyfile that need reverse proxy? (because it doesn't work for me now, but I don't know where the issue lies). For example like below?
|
Beta Was this translation helpful? Give feedback.
-
I just want to point out how important naming the volume is. If you don't name the volume the backup function wont work. I was having this issue when I followed the guide https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#caddy-recommended which lead me to this example. This is what it should look like:
Since compose V2 is using the parent directory of the compose file as a prefix for the volumes to avoid naming collisions. This can be avoided by either naming the container as above or using the external option. |
Beta Was this translation helpful? Give feedback.
-
I am coming from Truecharts with Traefik. I need newer versions of nextcloud, and they are severely behind. When I try to deploy this stack, I get the following error. I think I need to create volumes manually, but I'm not quite sure the right way to do it? |
Beta Was this translation helpful? Give feedback.
-
Is there a way to configure caddy (and NC) in such a way that NC master container and Apache are actually fully behind it? What I want to achieve is that caddy docker is not in a host network so that I can point Caddy straight to the master container (which is technically done, but we still expose Feels like such exposure of ports defeats the purpose of reverse proxy all together as services are reachable even without proxy. Sorry for posting it here, did not know where to put such question and here seems like it would be the best place. |
Beta Was this translation helpful? Give feedback.
-
This is what I did to use the dns check with duckdns: ~/Caddy/Dockerfile
~/compose.yaml
~/Caddyfile
|
Beta Was this translation helpful? Give feedback.
-
i am new into this guys, I don't know where to place the caddy file how to add it in it's place for it all to run correctly. |
Beta Was this translation helpful? Give feedback.
-
How could we run caddy via |
Beta Was this translation helpful? Give feedback.
-
I could not get this setup to work for me. The domain check just does not pass. The request comes as http on port 443, as per the docs, to which Caddy replies with "Client sent an HTTP request to an HTTPS server." Sending the request straight to Apache on $APACHE_PORT correctly replies with the expected string. Nothing I have tried to make Caddy pass this request to Apache works. |
Beta Was this translation helpful? Give feedback.
-
Hi, why does this approach not work on my setup? #6084 |
Beta Was this translation helpful? Give feedback.
Hello, I have something different in mind: See #588