Skip to content

Instantly share code, notes, and snippets.

@jschwindt
Last active March 21, 2024 00:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jschwindt/ee354f752679a23e0b99fa8da6610baa to your computer and use it in GitHub Desktop.
Save jschwindt/ee354f752679a23e0b99fa8da6610baa to your computer and use it in GitHub Desktop.
Caddyfile with Cloudflare TLS certificate generation
(common_directives) {
tls {$CLOUDFLARE_EMAIL} {
dns cloudflare {env.CLOUDFLARE_API_TOKEN}
}
encode gzip
}
{$NTFY_BASE_URL} {
import common_directives
reverse_proxy ntfy:8000
}
{$KUMA_BASE_URL} {
import common_directives
reverse_proxy kuma:3001
}
@jschwindt
Copy link
Author

A sample .env file for this Caddyfile:

KUMA_BASE_URL=https://uptime.example.com
NTFY_BASE_URL=https://ntfy.example.com

CLOUDFLARE_EMAIL=user@example.com
CLOUDFLARE_API_TOKEN=TOKEN_FROM_CLOUDFLARE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment