1. Caddy version (caddy version
):
Caddy v2
2. How I run Caddy:
Running Caddy v2 inside Docker
Nextcloud also running inside Docker
a. System environment:
Debian 10
b. Command:
c. Service/unit/compose file:
version: "3.7"
services:
caddy:
build: /opt/docker/caddy/dns-dockerfile
container_name: caddy
hostname: caddy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
- "3000:3000"
- "2023:2023"
- "2024:2024"
- "8126:8126"
- "2003:2003"
- "2004:2004"
- "8125:8125/udp"
- "8083:8083"
- "8082:8082"
- "8125:8125"
- "90:80"
- "25826:25826/udp"
- "8086:8086"
- "8090:8090"
- "8092:8092/udp"
- "8094:8094"
- "9090:9090"
- "9103:9103"
- "9100:9100"
environment:
- MY_DOMAIN
- CLOUDFLARE_API_TOKEN
volumes:
- /opt/docker/caddy/Caddyfile:/etc/caddy/Caddyfile:ro
- /opt/docker/caddy/data:/data
- /opt/docker/caddy/config:/config
networks:
default:
external:
name: $DOCKER_MY_NETWORK
d. My complete Caddyfile or JSON config:
{
email my@email.com
# acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
}
(webconf) {
# Add zstd and gzip compression to requests
encode zstd gzip
# Remove headers (leading "-")
header {
-x-powered-by
}
}
# Add common headers for non-reverse_proxy sites
(non_reverse_proxy_headers) {
header {
Strict-Transport-Security "max-age=31536000;"
X-Content-Type-Options "nosniff"
X-XSS-Protection "1; mode=block"
X-Frame-Options "SAMEORIGIN"
Referrer-Policy "strict-origin-when-cross-origin"
Content-Security-Policy "frame-src 'self'; frame-ancestors 'self'; object-src 'none';"
}
@cache_css_js {
path_regexp cache_css_js \.(?:css|js)$
}
@cache_media {
path_regexp cache_media \.(?:jpg|jpeg|gif|png|bmp|ico|swf|xml|ogg|m4a|mp3)$
}
# 1 week
header @cache_css_js Cache-Control max-age=604800
# 2 weeks
header @cache_media Cache-Control max-age=1209600
}
cloud.{$MY_DOMAIN} {
reverse_proxy nextcloud:80
header Strict-Transport-Security max-age=31536000;
redir /.well-known/carddav /remote.php/carddav 301
redir /.well-known/caldav /remote.php/caldav 301
tls {
dns cloudflare {env.CLOUDFLARE_API_TOKEN}
}
import webconf
}
3. The problem I’m having:
I can’t get AWS S3 to work as external storage.
4. Error messages and/or full log output:
5. What I already tried:
With the same environment setup, AWS S3 working with Nextcloud when use with Nginx Proxy Manager.