Just to be clear, Caddy always uses JSON as its configuration language. The Caddyfile is just syntax sugar to make it easier to write your config, but it’s parsed and adapted to JSON.
Caddy uses the config API internally to implement graceful reloads. It’s the most portable way to do this, because Caddy needs to run on all OSes and running an HTTP server is something that works everywhere.
If Caddy wasn’t running in the first place, then yes, reload
won’t work. That wasn’t clear from your post. You need to run it before you can reload its configuration! Once it’s running, the recommended way to change the config is to use caddy reload
to push the new config and do a zero downtime reload.