I’ve started using caddy as a replacement for nginx on a few projects, and broadly speaking, I like it.
It handles SSL setup nicely, it exposes lots of useful metrics for monitoring, and there isn’t the split between nginx and nginx plus when looking for documentation or tutorials.
Is anyone else using it for their config? If so, I’d find it useful to compare notes on getting it set up, as it’s well documented, and I find the config files really nice and readable.
As you can see, it’s pretty short, and this is a working production ready setup.
Running a slightly more complex version where you serve static files locally (i.e. serving the output of collectstatic from local directory called staticfiles at /static as well as media files from media at /media/) on the same computer isn’t much more code.
The upgrade to Django 4.0 added a wrinkle to this, which I’ve blocked at the link below.
TLDR: if you are behind Caddy, and you know you will be serving Django behind it, then you can add the following one liner for POST requests to work if you were using a version of Django older than 4.0, and have recently upgraded.