Download binaries or build from source (go get -u github.com/mholt/caddy).
Get excited!! Caddy 0.9 is coming, and its beta is available now. This means Caddy 0.9 is not yet considered stable for important production use, but we do want you to use it in production if you have smaller or unimportant sites to try it on.
Add-ons: During the beta period, we’ll be helping to transition existing add-ons into plugins for 0.9. Add-on authors must convert their add-ons into plugins, but it’s easy and I’m willing to help answer questions. If you’re an add-on author, I’ll be reaching out to you individually after we figure out details regarding the updated build server…
Caddy 0.9 is not finished yet and this is not a release announcement. Some more changes and work is going into Caddy before the 0.9 release. Check this thread or GitHub for newer beta versions!
Version 0.9 re-focuses Caddy on serving. That is what it does best. It just happens to serve HTTP by default. And it serves the user by making things easy. And we’ll continue to emphasize serving the user before the Web.
Things to Be Aware Of
This is the biggest change yet. I rewrote Caddy from an empty func main() { } and brought over functions or files one at a time from the old code base as needed. Caddy is now much more flexible and, I believe, robust. Its logic is more clearly separated and simplified in many cases.
Most of the middleware is unchanged, and how you use Caddy is mostly the same.
The markdown directive no longer performs static site generation. But it still renders Markdown on-the-fly, of course!
TLS assets stored in $HOME/.caddy/letsencrypt folder have moved to $HOME/.caddy/acme and are reorganized by the hostname portion of the -ca URL. It doesn’t work to mix accounts and keys with different CAs, so now we organize these files by the name of the CA. We also lower-case all the hostnames and email addresses so they are not case-sensitive. Caddy quietly facilitates this migration for you when you first run it. You should not notice anything.
Caddy’s main() function moved to github.com/mholt/caddy/caddy, with the actual logic in github.com/mholt/caddy/caddy/caddymain. The build script (build.bash) has also moved down into the caddy subfolder.
The caddy package that other Go programs import to use Caddy as a library is now the top-level package, making the import path simply github.com/mholt/caddy.
Things to Try
Make sure everything that used to work (that should work), still works. Then try any of these.
Experimental QUIC support. Use -quic to enable it for HTTPS sites. Learn more
Paths in site addresses. There is no inheritance; all sites are distinct. These two sites will be treated as separate sites, even though they share a host and port:
example.com/foo {
}
example.com/bar {
}
Site addresses can now have wildcards in their hostname. Use of wildcards must conform to RFC 6125. In other words, *.example.com is valid, but *ample.com is not, and neither is example.*. So, *.example.com will match sub.example.com but not sub.sub.example.com. The reason for this is in case automatic HTTPS is able to get wildcard certificates in the future.
DNS challenge. When you need a certificate from Let’s Encrypt but can’t bind to a low port (80 or 443) or that port can’t be accessed from the outside, try the DNS challenge. Make sure you plug in your DNS challenge provider and set credentials in environment variables. See linked repo for docs; we’ll have full documentation coming soon.
tls {
dns cloudflare
}
Graceful reloads (signal USR1) without spawning a new process. Hurray! Make sure it works well for you.
Self-signed certificates generated for you. Use tls self_signed in your Caddyfile for Caddy to generate and use a self-signed (untrusted) certificate for that site. Great for local dev and testing. You can bypass certificate warnings in Chrome for localhost sites by using a Chrome flag.
Write a new plugin for Caddy. Plugins can not only inject middleware, they can change how the Caddyfile is loaded, or even implement a server type. Thus, the HTTP server is a plugin. Learn how and give feedback to improve the wiki!
See which plugins are plugged in by running caddy -plugins (replaces -directives)
The {request} placeholder in log formats. If you want to dump the whole request (minus the body) to a log file.
Specify multiple upstreams with port ranges using the upstream keyword in the proxy directive.
Change the storage location from $HOME/.caddy to a custom folder of your choosing by setting the $CADDYPATH environment variable.
If you found yourself doing this in your proxy directives:
try replacing those lines with a single transparent keyword. This preset sets those headers for you.
Beta version updates
There will almost surely be more than one beta version. Check this thread and the GitHub releases for updates! And follow @mholt6 and/or @caddyserver on Twitter.
Feedback
Be sure to open an issue if you find bugs, or start a new thread in the forums if you have other questions or feedback. Thanks for trying Caddy!
Is LE going to allow you to do this? It’d be awesome for putting customers on their own subdomain.
Will there be some kind of check done before getting a cert the first time? I’d hope it wouldn’t register a cert if somesubsite.example.com is a 404. If it did then anyone could DDOS your LE quota.
I’m not going to deploy it just yet, but I shall keep an eye on this and when I’m next doing maintenance on https://alfiepates.me I will most likely upgrade Caddy too!
Hey Chris, thanks for the report! I recently found out this happens when you bring your own certificates (a recent change made it sneak by a test I did; working on that) – but the fix has been committed already: https://github.com/mholt/caddy/commit/daa4de572e92668e8b40024c641cdd3d9fa6f21c - and will be available in beta 2.
Yes I know that’s an option, I’m just reporting a possibly unintended behaviour, as some people may expect the configuration I posted above to actually show the file browser page.
I do believe the most specific site is supposed to match first. But I think right now you have to order them with the most specific first in the Caddyfile (though this is supposed to be changing.)