3 ms·
Yes, it's pretty nice and sometimes is even nicer than nginx in some regards. E.g. it notices DNS changes without SIGHUP, so if your app is containerized, Caddy
by drdaeman 10y ago
Yes, it's pretty nice and sometimes is even nicer than nginx in some regards. E.g. it notices DNS changes without SIGHUP, so if your app is containerized, Caddy just works when you start and stop containers, when nginx requires special tricks.
However, it lacks in some areas, for example if you need some complex regex-based routing it could be somewhat unpleasant (while probably doable, the configs would look really messy).
- majewsky 10y agoWait... why would a web server need to know about changing DNS?
- drdaeman 10y agoIt doesn't need to know about the changes, but it surely needs to notice them as they happen. For example, FLOSS nginx does DNS lookups just once on startup. On config (re)loads, to be exact. E.g. when you have "proxy_pass http://spam;" http://spam;" or "uwsgi_pass spam:9000;", you'll end up with permanent 502 (until a SIGHUP) after you've started a new "spam" Docker container and then removed the old one. There are well-known workarounds like "set $backend "http://spam"; http://spam"; proxy_pass $backend;", but it's nicer when you don't even have to think about this and know that TTLs are properly honored. Caddy does that.
- hdhzy 10y ago> Caddy just works when you start and stop containers That doesn't sound great for zero downtime deployment but > notices DNS changes That sounds like it could support zero downtime (new container started, DNS records updated to this new container and then stopping old container). Is this something like DNS SRV support in Nginx Plus? [0] [0]: https://www.nginx.com/blog/service-discovery-nginx-plus-srv-records-consul-dns/ https://www.nginx.com/blog/service-discovery-nginx-plus-srv-...