# The Caddyfile is an easy way to configure your Caddy web server. # # Unless the file starts with a global options block, the first # uncommented line is always the address of your site. # # To use your own domain name (with automatic HTTPS), first make # sure your domain's A/AAAA DNS records are properly pointed to # this machine's public IP, then replace ":80" below with your # domain name. { email {$ACME_EMAIL} # ステージング用に変えてあるので本番ではコメントアウトする acme_ca https://acme-staging-v02.api.letsencrypt.org/directory # DDNS用の設定 dynamic_dns { provider cloudflare {env.CLOUDFLARE_API_TOKEN} domains { example.net @ } ip_source simple_http https://api64.ipify.org versions ipv4 check_interval 24h } } # それぞれのホストはCloudflareでCnameを作っておく *.example.net { tls { dns cloudflare {env.CLOUDFLARE_API_TOKEN} resolvers 1.1.1.1 } @authelia host auth.example.net handle @authelia { reverse_proxy authelia:9091 } @headscale host hs.example.net handle @headscale { reverse_proxy headscale:8080 } @komga host komga.example.net handle @komga { reverse_proxy komga:25600 } # Fallback for otherwise unhandled domains handle { abort } }