Mixing Caddyfile and JSON mixing

Logging is pretty powerful in v2, so it takes a lot of work to expose it in the Caddyfile. It’ll probably happen eventually, but not right away.

My usual v2 logging advice applies: just log slightly more than you need, then filter out lines you don’t want. Since it’s structured, this is very flexible and can be automated with any number of tools.

Well, for some workflows. Remember that over the course of 6 years we’ve seen a lot of use cases.

Not at the moment, but there is some talk of a module that can generate a config from multiple sources: Caddy v2? · Issue #130 · lucaslorentz/caddy-docker-proxy · GitHub

The point is, a single JSON doc sounds inconvenient but then you realize you can layer any other tooling or logic on top of it, and suddenly it becomes the most versatile format ever. Especially when you consider that this logic can be embedded into Caddy either as a config adapter or some other module, so it’s not like you have to hack together a bunch of external tools to make it work. Caddy is capable of doing what you want in the way you want, but somebody has to spec it out and write some code, at some point.

Since the Caddyfile just becomes JSON and then fed into the same API endpoints that @Whitestrake linked to, yes. But note that you can’t go from JSON to Caddyfile; it’s a one-way street.

1 Like