Nginx Development Guide
nginx.org
nginx.org
- JavaScript: https://nginx.org/en/docs/njs/ and https://github.com/nginx/njs-examples
I haven't tried it yet, but it looks promising.
- Perl: https://nginx.org/en/docs/http/ngx_http_perl_module.html
Disclaimer: I help maintain Caddy
- Both Caddy and nginx are really fast.
- Both can handle high traffic loads.
- Caddy and nginx have different failure modes. Nginx will drop requests. Caddy will hang onto them and serve them even if it takes longer.
(Note that "Caddy" is basically equivalent to "Go" -- we use its std lib HTTP implementation. It's really comparing Go and C.)
The reasons for this are:
1. Automatic ACME integration in Caddy compared to the mess of containers something like nginx-proxy-manager is or the unreliability of external solutions like certbot or acme.sh
2. nginx's config. Footguns like if are well known, but even just if you want to deploy a nginx server with virtual hosts, did you know that if there is no Host header nginx serves the site evaluated first in its config file (even if the site has a server_name directive)? This is fine for an enterprise deployment where you probably only have one site behind nginx anyway, but as someone who has their side projects share servers to cut down on costs, it's really undesirable. There is a way around it by setting up a default host to explicitly serve errors, but it's just a chore I don't have on Caddy.
3. I can use Caddy on the CLI for testing also, in a way that's a more advanced replacement for python -m http.server etc. for more advanced use cases, or even just setting up server config rules.
Before that it goes to the one named "" and if that doesn't exist, the one with default_server.
If traffic with no Host header went to no server by default, people would also call that a footgun...
do you mean develop on Caddy itself or use Caddy as a webserver for a website you're developing?
I got Caddy to run on my vacuum cleaner in a few minutes with no prior experience. I think that's pretty cool.
I understand that one can probably methodologically master caddy, but from the perspective of someone who has been running web servers for decades and just needs to get things done, my god, caddy has the worst documentation of any product I've ever seen, and the most confusing configuration I can possibly imagine.
Confusion over v1/v2/json/yaml formats, documentation showing tiny snippets without telling how where they fit, etc. Not even ChatGPT4 can write caddy configuration.
For a long time I thought that my caddy config was blocking all IPs except the ones I listed. Turns out that no. The shit I wrote did nothing.
TLDR: Don't fall for the hype. Nginx is excellent.