Experience with Caddy webserver

About a month ago, I changed webserver from nginx to caddy.

The difference between the two is that nginx is the lean battletested major server, whereas caddy is simpler younger and surprisingly easy to use.

I still recommend nginx (which is more mature), if you do not have the need for easy ssl-certificates and similar other features.

My experience with caddy has been very positive, – it just worked for the setup I needed.

Recently I have used it in two additional ways

  • I needed a API-cors-proxy for a project I was working on, – it was almost trivial to setup.
  • Instead of checking out the project I host, I have begun using caddy’s git-addon, which works like a charm. With webhooks, new versions of webapps are online immediately after I push to github, without any manual interaction.

The minor downsides that I have had are

  • Minor configuration tweaks: needed to add Host header etc. manually when proxying, and needed to Access-Control-Allow-Credentials header etc. when cors’ing. – not really an issue
  • Caddy only starts if all sites works, and fails otherwise, – would be better if it started regardless (ie. some new sites initialisation fail due to letsencrypt-throttling, and then nothing worked, including other production sites).
  • Slow startup after changes to configuration (server should just start serving, and then do additional initialisation in background, instead of waiting for all initialisation (including checking out git repositories) before starting up).

but overall everything just works!
– which is amazing, so I’ll highly recommend it.