Most popular

What do you need to know about Caddy 2?

What do you need to know about Caddy 2?

The days of hacking your deployment workflows around the limitations of your web server are over! Caddy 2 is a highly extensible, self-hosted platform on which you can build, configure, and deploy long-running services (“apps”).

Why are rewrite hacks no longer necessary in Caddy 2?

“Rewrite hacks” are no longer necessary in v2, because the Caddyfile now lets you match on any property of the request—not just path. You also have total control over your HTTP routes when you need it. Atomic: Multiple changes in a single request are treated as a single unit; any failed change aborts all the other changes.

What kind of certificate authority does Caddy use?

Powered by open source Smallstep libraries, Caddy automatically acts as a fully-featured, self-hosted CA when necessary. If you configure sites with local or internal addresses (e.g. localhost or IP addresses), Caddy will still serve them over HTTPS using its locally-trusted certificate authority with short-lived, auto-renewing certificates.

Which is the best config language for Caddy 2?

Although Caddy 2’s native config language is JSON, most users prefer the Caddyfile for its simplicity. In Caddy 2, we’ve kept the best parts of the Caddyfile and polished the rough parts. “Rewrite hacks” are no longer necessary in v2, because the Caddyfile now lets you match on any property of the request—not just path.

When to use Caddy start or Caddy run?

That means your terminal won’t unblock after you execute caddy run until the process is terminated (usually with Ctrl+C). Although caddy run is the most common and is usually recommended (especially when making a system service!), you can alternatively use caddy start to start Caddy and have it run in the background:

Is there a Caddyfile in the current directory?

If there is a file called Caddyfile in the current directory and no other config is specified, Caddy will load the Caddyfile, adapt it for us, and run it right away. Now that there is a Caddyfile in the current folder, let’s do caddy run again:

When do I need to activate automatic https in Caddy?

Caddy implicitly activates automatic HTTPS when it knows a domain name (i.e. hostname) or IP address it is serving. There are various ways to tell Caddy your domain/IP, depending on how you run or configure Caddy: Any of the following will prevent automatic HTTPS from being activated, either in whole or in part:

How can I start caddy without a subcommand?

Oops; without a subcommand, the caddy command only displays help text. You can use this any time you forget what to do. To start Caddy as a daemon, use the run subcommand: This blocks forever, but what is it doing? At the moment… nothing. By default, Caddy’s configuration (“config”) is blank.

Author Image
Ruth Doyle