4 ms·
Caddy is such a delight! I can't reccomend it fast enough when somebody mentions they are on nginx. Small random feedback: I like the idea of JSON configuratio
by evv 4y ago
Caddy is such a delight! I can't reccomend it fast enough when somebody mentions they are on nginx.
Small random feedback: I like the idea of JSON configuration but most of the common docs/recipes are documented only with the Caddyfile format. I couldn't figure out the full JSON schema that was expected so I wound up generating a Caddyfile string instead for my programatic control. Maybe there is some translation tooling that could help?
- codazoda 4y agoIt seems that this command will translate the Caddyfile to json. ./caddy adapt
- mholt 4y agoThanks for recommending it! I hear ya. The JSON config is definitely not trivial. I wrote our JSON docs and strove to made them easy to follow. You can traverse into the module structure piece-by-piece here: https://caddyserver.com/docs/json/ https://caddyserver.com/docs/json/ There is also a Caddy plugin by @abiosoft that can generate a JSON schema for your custom Caddy builds, which can then be used by IDEs to give you autocomplete and validation: https://github.com/abiosoft/caddy-json-schema https://github.com/abiosoft/caddy-json-schema I also sometimes recommend writing your config by hand in the Caddyfile, then using `caddy adapt` to get the JSON equivalent. (It might not always be the prettiest JSON, since the adapter is only so smart.) But then you can fine-tune the JSON a little easier, possibly. Hope that helps!
- skrause 4y agoA few complete, fully working example JSON configuration files for common use cases would be really useful as well.
- mholt 4y agoAgreed. (Although, for now, you can run caddy adapt on your Caddyfile to get the JSON you're looking for.)
- evv 4y agoThanks! Somehow you knew that I was struggling with JSON config of a custom Caddy build (for the Cloudflare extension) caddy-json-schema looks great, I'll try this next time! not sure if I totally missed `caddy adapt` or if I had troubles with it.
- sgt 4y agoI'm a heavy nginx user - there's not much that I haven't already done with it and I know the documentation quite well. Why would someone like me change to Caddy? I can see there are some NGINX Plus features that are free in Caddy.
- tdhz77 4y agoSingle binary is nice, live config changes, let’s encrypt is built in.
- evv 4y agoI wouldn't put effort into changing if you have no troubles with nginx. Caddy has some neat features like live-configuration and built in LetsEncrypt. Plus the JSON configuration is a great idea, once I get it working. The real reason is the thing you highlighted: "I can see there are some NGINX Plus features that are free in Caddy." Sadly it seems that NGINX is now crippleware. Personally I find it risky to depend on open source organizations who refuse to accept important features to the project, so they can sell those features as proprietary.
- number6 4y agoBack in the days, there was an issue with caddy regarding having to pay for it if you bundle some plugins with it. I can't remember now - must have been years ago. This is why I ultimately landed at traefik and nginx as my go-to setup. Is this still the case?