June 13, 2018

Using Caddy for serving static content

I have a bunch of static files/websites laying around so I stood up an Amazon Lightsail instance and installed the Caddy web server.

static.baty.net

A cool thing about Caddy is that it handles provisioning and installing SSL certificates automatically from Let’s Encrypt without me doing anything. It also automatically redirects from http to https.

Here’s the entire config file (Caddyfile)

nil static.baty.net { root /home/jbaty/apps/static log /home/jbaty/logs/static.baty.net.log gzip browse }

The browse directive enables directory browsing, and it even looks decent.

Caddy can do all sorts of neat tricks, like serving up Markdown files as HTML pages. Just drop Markdown files in a folder and add a markdown directive. I’m sure I’ll find a use for that. It would be neat if it could do the same with Org-mode files.

I’m sure I’ll explore the various plugins available. I see there’s one for Hugo sites, which looks interesting.

Having super-simple HTTPS automatically should be compelling for people looking to get on the HTTPS-everywhere train.


Previous post
I like using Fossil but I’m not sure I want to live without Magit.
Next post
I hope the next MacBook Pro is twice as thick.