caddy-docker-proxy
caddy-docker-proxy copied to clipboard
DNS challenge with Cloudflare
I've downloaded a custom build that includes this plugin and the Cloudflare plugin. It works with manually configured sites using the Caddyfile using DNS challenge. I'm not sure how to get it to work with containers configured to use caddy-docker-plugin, or even if it's possible. Any help would be appreciated.
This plugin just produces Caddyfile config. If you can do it with a Caddyfile, you can do it with this. You just need to transform it to Docker labels.
Thanks, after finding this and getting it to work, I think I understand better now.
https://github.com/homeall/caddy-reverse-proxy-cloudflare
Can this work with an existing Caddyfile in addition to these dynamically generated ones? I assume not, but making sure I understand completely.
Can this work with an existing Caddyfile in addition to these dynamically generated ones?
If you just want to add some Caddyfile contents of your own you could mount separate files into the CDP image and use the import directive as a label to add such.
- If you want to have a base
Caddyfile, then add that to the container and use the ENVCADDY_DOCKER_CADDYFILE_PATHto reference it. - When you use
import, the path might need to be absolute, any nested imports can be relative from that. Or justimportsnippets from the baseCaddyfileto avoid paths in the labels👍 - Keep in mind that any args to a snippet
importmay need to be quoted appropriately to work. Likewise be careful of typos which may introduce invalid config but silently "fixed" by CDP.