6 ms·
When would I use Caddy, rather than using nginx and configuring Let's Encrypt for myself? Honest question.
by blowski 10y ago
When would I use Caddy, rather than using nginx and configuring Let's Encrypt for myself? Honest question.
- knrz 10y agoI feel like the niche Caddy's trying to fill is for people who don't want to bother with that, or don't want to learn. If you already know how to set up nginx and LE (like you and I do), its only appeal is relatively minor: potentially saving a quarter or half hour.
- xiphias 10y agoI think over time there will be a similar server written in Rust, where at least we can be sure that there are no buffer overflows..until then nginx is probably better in every situation.
- shawabawa3 10y agoCaddy is written in go, not C, so I'm not sure why it should be especially vulnerable to buffer overflows...
- ilogik 10y agowhy would there be buffer overflows in caddy?
- Sphax 10y agoDo we really need someone to mention Rust in every thread ?
- anaganisk 10y agosomeone had to say it :p
- afdsadf 10y agoAs a member of the Rust Evangelism Strike Force, I am morally obligated to. /s
- xiphias 10y agoNo, it just makes sense to have a fast and safe HTTP server at the same time. Go is ona average 3x slower than C according to bechmarks, and it's hard to get rid of this issue because of how the language is architected. I just don't see Caddy as a possible long term replacement for nginx.
- coldtea 10y agoUnless it uses unsafe code (which Rust also provides) Caddy wouldn't have buffer overflows either, since Go is garbage collected and doesn't allow for the kind of pointer arithmetic C does in normal code.
- deleted 10y ago[deleted]
- interfixus 10y agoits only appeal is relatively minor Is that factual, or also something you feel like? To us simple folks, you know, it looks as if Caddy has a number of use cases where it's a much neater fit than nginx. We like the extreme simplicity and the transparency of it all. Some of us also like the Go it's written in. What with the magic Go modularity, you can actually embed this server in your web-app. Or is it the other way round? Comes in handy, at any rate.
- knrz 10y agoThat was a feel. I never thought of the idea of embedding it. Thanks for teaching me more!
- grey-area 10y agoWhat with the magic Go modularity, you can actually embed this server in your web-app. Or is it the other way round? Comes in handy, at any rate. It's the other way round. You can embed your app in the server if you want to get its features for free, though given it uses net/http and most of the features are exposed there you should probably just use that directly instead if you are doing anything significant.
- yjftsjthsd-h 10y agoI'm not opposed to learning, but it's like learning emacs when nano legitimately covers all your use cases: potentially useful, but unconvincing ROI. And if we pretend for a moment that it's really only a quarter hour saved, why would I not save that time if all other things are held fixed? Caddy isn't the universal solution, but it sounds like you're rationalizing using the more complex tool because you know it and have been using it rather than because it's necessarily superior.
- atonse 10y agoThe appeal is huge for a huge number of people. It's an opinionated web server. I've used nginx for probably 6-7 years, and not once have I done something I'd consider that special (I've setup fpm, passenger, gzipping of content, TLS, regenerating my DH param, etc). Every single thing I've done, could be implemented in an opinionated away by the web server. I'd love to just say "php" and have it do the right thing. In fact, I'd go as far as to say, it would be amazing if I could just say "proxy ____ drupal" instead of php, and it'll add the drupal rules as well.
- overcast 10y agoWhen you're a solo entrepreneur/developer/sysadmin/whateverhatineed hat I need to wear. Streamlining processes as much as possible is a good thing. Using something overly complex, just to use it, is silly. I stumbled upon Caddy, because I was struggling with getting LetsEncrypt setup properly for all my sites on Nginx. Now with a few lines of config, all my sites use, redirect to, and update their certificates automatically. One less piece of bullshit I need to sift through for all the projects I'm working on. In my opinion, something like SSL certificates SHOULD be an automated process.
- andmarios 10y agoIt all depends on how complex your setup is. Caddy isn't just easy to setup, it is easy to setup every part of it until you reach the end of its functionality. I can set up both nginx and apache (and get paid for it), I've automated LE for new sites via ansible, etc. Nowadays if I can do with caddy, I just use that and proceed to the next task. Also remember that easy (and short) configuration means easier maintenance. Devs also love it, they can develop locally using advanced functionality (e.g proxying an API that doesn't provide CORS).
- dev247 10y agoI made the complete switch to Caddy just because the configuration is simplified and it has features like git webhooks built-in. Setting up BasicAuth on a directory is one line in the config. And it's fast. No issues so far, been using Caddy for over a year now.
- anc84 10y agoI vouched for this comment to bring it back from dead. dev247, you seem ghosted for all the account's lifespan for no apparent reason. Contact hn@ycombinator.com to get reset to a proper user account!
- interfixus 10y agoSo did I. What's the deal with this absolutely harmless comment being going all grey and dead?
- anc84 10y agoThe account was probably automatically flagged by some algorithm 3 years ago. Yay for smart machines and no human oversight!
- shawabawa3 10y agoWhy would I use nginx and go through the hassle of configuring let's encrypt and sane SSL settings when I could just use caddy? But seriously, for all "hobby" projects I've started recently, and even some production services now, I go straight to caddy. My config consists of a 1 line global config file: import sites-enabled/* And 90% of the individual services have this config: example.com { proxy / http://localhost:5000 { header_upstream Host {host} } } Compared to nginx it's just so much simpler and so far I haven't found myself missing a single feature. (In fact, caddy has active health checks, which nginx only supports for its extortionate enterprise fee)
- blowski 10y agoWhat's the performance like? Can you use it as a proxy server?
- shawabawa3 10y agoI use it exclusively as a proxy server. I've never noticed any performance issues, I think I saw a benchmark where it said caddy can handle 2000req/s, which is at least an order of magnitude or 2 faster than any upstream service I've used it in front of.
- coldtea 10y ago>I think I saw a benchmark where it said caddy can handle 2000req/s Those are application level numbers (e.g. with logic and all). Caddy should be able to handle an order of magnitude more req/s than that easily.
- anc84 10y agoOne year ago Matt said 30000req/s: https://forum.caddyserver.com/t/can-i-use-caddy-for-a-high-traffic-site/108/15 https://forum.caddyserver.com/t/can-i-use-caddy-for-a-high-t...
- shawabawa3 10y ago
- grey-area 10y agoIt's a lot easier than ngxinx + letsencrypt + cron job - there is zero config to get letsencrypt up and running and certs renewing automatically. It supports http2 out of the box and will keep improving as the go net/http library does, performance is good (certainly good enough for 99.9% of the static sites out there, I haven't specifically benchmarked against nginx but response times didn't change much). I'd recommend it as a proxy if you need one, particularly if you need one that handles your tls certs.
- singlow 10y agoI use Nginx in production, but caddy on my dev machine, where I might have dozens of test sites running at any time. Those sites all live on subdomains of a dedicated dev domain and I rarely create more than 2 or 3 per week so I can always just use https with certificates generated on the fly. In Nginx I would need to constantly re-run certbot to add subdomains manually.
- eliaspro 10y agoFor all local/non-public instances I just use "tls self_signed" and have Caddy generate a cert on demand.
- nemothekid 10y agoA lot of the other responses have been focusing on how simple Caddy is to get started with - batteries included. We've been using Caddy for a bit over 2 years in production. At the time we had just moved our infrastructure from an assortment of self-written python scripts to Mesos/Marathon. We were looking for a solution that would reverse proxy to our app servers without having to rely on DNS. I initially thought about writing a plugin for nginx before I found Caddy. When we found Caddy, it was a better solution for us as it was far easier to write a mesos integration for rather than trying to integrate it into nginx.