I want to rewrite my current setup to use automatic on demand TLS SSL cert pull with Let’s Encrypt using Cloudflare. It must be wildcard. I currently have it already setup using a stored certificate that is manually pulled once year and I want to move away from that. I also need to change the domain name from *.test.org to *.test2.com
You might not need it to be actually on-demand - if you know what the domain name is going to be, you could just have Caddy actively maintain the certificate and save yourself a little bit of complexity. But if you do need to only requisition the certificate on-demand, I can point you to the docs for On-Demand TLS to get you started. You’ll need to set tls { on_demand } in your site block and configure an ask endpoint in your global options in order to mitigate bad actors abusing your setup, the doc will explain those further.
As for doing this with the Cloudflare DNS module, I can point you at a helpful wiki post:
I already have the standard caddy version with no cloudflare module. It is as easy I just pulling the one with the module and overwriting everything?
I would probably no do the tls on-demand then and just use the 90 day tls certs that are built-in to the module. Would there be anything special I need to adjust besides removing the location to the current TLS cert?
It kinda depends on how you installed Caddy. You just wrote you installed “Normal with no module add-ons like cloudflare” but that’s what you installed, now how; it matters whether you used apt, or if you downloaded from the website, or if you’re using Docker, etc etc etc.
In the case of a Debian based package manager there’s some extra steps you’ll want to follow to keep systemd integration. For a downloaded binary you can just download a new binary or run caddy add-package. Docker would have to build a custom image.
Nope, just add the Caddyfile config required to enable the DNS challenge, then remove the line importing your manually provided cert/key, then reload/start Caddy and watch the logs to make sure it all goes off without a hitch. Give us a shout here if it goes awry.
On-Demand TLS is for when you don’t know the domains ahead of time. In your case, you do, you know you want a wildcard cert for your specific domain. So that’s not the feature you need.
But like Matthew said, your post was incomplete so we’re not sure how you’re actually running Caddy. We need to know that to know how to best help you.
This is invalid syntax, you can’t have path in a proxy upstream address (i.e. the /sabnzbd at the end of that line).
You really don’t need any of this. Don’t set headers you don’t understand. Properly designed apps will set their own security headers as needed. In fact, you could be breaking some of the apps with this by overriding the headers the apps try to set.