TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Caddy is the first and only web server to use HTTPS automatically and by default

161 pointsby aabbcc1241over 1 year ago

22 comments

BilalBudhaniover 1 year ago
I believe Caddy brought a much needed paradigm shift in web server space, it is an incredible piece of technology.<p>I have moved all my servers from NGINX to Caddy for the pass few years and I couldn&#x27;t be happier.<p>Also, I would like to give a shoutout to the team behind Caddy. They have been nothing but great about constantly shipping updates and being incredibly helpful in their community forum.
评论 #37477798 未加载
评论 #37477901 未加载
supz_kover 1 year ago
Just a personal experience. About 6 months ago, we moved from NGINX to Caddy on our web app, which handled about 300 million HTTP requests per month at that time (2 web servers, so about 150 million each)<p>CPU Usage:<p>with NGINX - 15-20% with Caddy - 70-80%<p>I tried multiple tweaks but nothing helped to get NGINX-level performance. So, after a few weeks, we migrated back to NGINX.<p>That being said, I still absolutely love Caddy and use it in a few small scale apps.<p>- The DX it provides is amazing. - Creating a PHP-FPM reverse proxy is just a couple of lines. - Generating SSL certificates on the server is a breeze. With NGINX, you have to mess with other software like certbot. - It just works :)
评论 #37480687 未加载
评论 #37479874 未加载
评论 #37479794 未加载
评论 #37484732 未加载
melxover 1 year ago
I did benchmark it against nginx and found Caddy to be 5-7x times slower, but like all benchmarks go...results are subject to ones requirements (or mistakes).<p>What got me away from using it:<p>- the directives feel intuitive but as soon as I needed a complex config it all became a chain of very implicit strings<p>- the caddy author(s) decided few years ago to add custom http header with their sponsors[0]. That header could not be removed, it&#x27;s no longer present in current Caddy but the bad taste still remains.<p>[0] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=15238315">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=15238315</a>
评论 #37479673 未加载
评论 #37478963 未加载
评论 #37479021 未加载
评论 #37478896 未加载
评论 #37478500 未加载
teekertover 1 year ago
I love caddy, I used to litter my docker-compose.yaml files with Traefik labels like:<p><pre><code> labels: - traefik.enable=true - traefik.http.routers.foundryvtt-http.entrypoints=web - traefik.http.routers.foundryvtt-http.rule=Host(`vtt.xxx.nl`) - traefik.http.routers.foundryvtt-http.middlewares=foundryvtt-https - traefik.http.middlewares.foundryvtt-https.redirectscheme.scheme=https - traefik.http.routers.foundryvtt.middlewares=foundryvtt-auth - traefik.http.middlewares.foundryvtt-auth.basicauth.users=${foundryvtt-BASIC_AUTH} - traefik.http.routers.foundryvtt.entrypoints=websecure - traefik.http.routers.foundryvtt.rule=Host(`vtt.xxx.nl`) - traefik.http.routers.foundryvtt.tls=true - traefik.http.routers.foundryvtt.tls.certresolver=mytlschallenge - traefik.http.services.foundryvtt.loadbalancer.server.port=30000 </code></pre> Now I just add the containers (by name), no labels, and map Caddy to their port, like so (in the Caddyfile):<p><pre><code> data.xxx.com { reverse_proxy projectsend:80 } </code></pre> or, this snippet refers to a WordPress container with BasicAuth in front of it:<p><pre><code> restricted.xxxx.com { root * &#x2F;var&#x2F;www&#x2F;html&#x2F;restricted.xxxx.com&#x2F;wordpress php_fastcgi wordpress-xxxx-restricted:9000 { root &#x2F;var&#x2F;www&#x2F;html } basicauth &#x2F;* { xxx $xx$x05xxxxxxxxx.xx } file_server } </code></pre> Here&#x27;s just an index.html (from Hugo in this case) in some dir:<p><pre><code> blog.xxx.nl { # Set this path to your site&#x27;s directory. root * &#x2F;var&#x2F;www&#x2F;html&#x2F;blog.xxx.nl # Enable the static file server. file_server } </code></pre> I love the simplicity.
评论 #37479044 未加载
评论 #37479696 未加载
zoidbover 1 year ago
Caddy had been a joy for me personally coming from NGINX. I especially love the ease of adding a new site and how little config it takes. Small self plug, I recently wrote an article about some cool config examples <a href="https:&#x2F;&#x2F;jarv.org&#x2F;posts&#x2F;cool-caddy-config-tricks&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;jarv.org&#x2F;posts&#x2F;cool-caddy-config-tricks&#x2F;</a>
评论 #37477552 未加载
评论 #37477570 未加载
fodkodraszover 1 year ago
Backing the days (5+ years ago I think) we tried it, and while it was nice its licensing&#x2F;pricing made us not use it for our startup, as it seemed to pose a sustainability threat when growing (or not growing the right pace).<p>Has it improved since then?<p>disclaimer: I don&#x27;t remember the details, I was just told to use nginx because caddy is problematic, so I built the system with nginx open source.
评论 #37477742 未加载
评论 #37477718 未加载
评论 #37477684 未加载
yakubinover 1 year ago
I like Caddy, mainly for the ease of configuration. One thing that surprised me though: by default it has compression disabled. I discovered it 1 year after moving from nginx (with the nginx config having compression enabled) and it was funny, because at the time of migration I got comparable performance out of the two. Obviously, after enabling compression, it’s faster now.
评论 #37481464 未加载
评论 #37483624 未加载
dxuhover 1 year ago
I&#x27;m always a bit bothered by them saying they are the &quot;only&quot; web server that can do this. First you can also just configure it in a way where it will not use HTTPS (e.g. if you provide an IP:port instead of a hostname). And if you do require specific configuration to enable HTTPS and automatically get certificates via ACME, then lots of other web servers can do this too. Even my own web server can do it: <a href="https:&#x2F;&#x2F;github.com&#x2F;pfirsich&#x2F;htcpp">https:&#x2F;&#x2F;github.com&#x2F;pfirsich&#x2F;htcpp</a> (see <a href="https:&#x2F;&#x2F;github.com&#x2F;pfirsich&#x2F;htcpp&#x2F;blob&#x2F;main&#x2F;configs&#x2F;acme.joml">https:&#x2F;&#x2F;github.com&#x2F;pfirsich&#x2F;htcpp&#x2F;blob&#x2F;main&#x2F;configs&#x2F;acme.jom...</a> for an admittedly much more complicated config).
评论 #37483499 未加载
评论 #37481195 未加载
KronisLVover 1 year ago
Caddy seems to be continuously getting better and I think mholt occasionally hangs around here and is a rather pleasant person.<p>I recall once needing to help a new person in another team setup TLS after they had tried to do it unsuccessfully themselves in some configuration (that might have had a networking setup where HTTP-01 for ACME doesn&#x27;t work, actually). I just started recording my desktop, grabbed a server from Hetzner live and thanks to Caddy could give them an example of how things should work with all of the steps in like 5 minutes total.<p>Nowadays I use Apache (mod_md) for my personal needs due to some plugins I need, it actually makes me wonder why Nginx doesn&#x27;t seem to have integrated support for ACME yet, even if certbot is serviceable too. Either way, props to Caddy for raising the bar for web servers.
TigerTeamXover 1 year ago
I love Cadd and I have been using it for a few years now. The documentation is kinda crap, but I still use less time to get things done. Most projects are just copy&#x2F;paste of old config files. Everytime I had a problem, I asked and got an answer within 2 days. And nice answers, not like Stackoverflow...
评论 #37483767 未加载
评论 #37483364 未加载
trinovantesover 1 year ago
I&#x27;m currently reverse proxying a few docker containers with nginx. Caddy seems tempting but one dealbreaker I can&#x27;t find in the docs is whether or not it automatically refreshes its DNS cache if a docker container restarts and changes its IP address?<p>e.g. In nginx, I use &quot;resolver 127.0.0.11 valid=30s&quot; so &quot;proxy_pass {container}:80&quot; will only cache the {container}&#x27;s IP address for 30s
评论 #37478778 未加载
评论 #37478926 未加载
foucover 1 year ago
Caddy was the first to default to https.. because it was new. Nothing special about that.
评论 #37478804 未加载
评论 #37484094 未加载
asimopsover 1 year ago
The thing I am missing the most is some kind of HTTP-01 by proxy, like <a href="https:&#x2F;&#x2F;github.com&#x2F;acmesh-official&#x2F;acme.sh&#x2F;wiki&#x2F;Stateless-Mode">https:&#x2F;&#x2F;github.com&#x2F;acmesh-official&#x2F;acme.sh&#x2F;wiki&#x2F;Stateless-Mo...</a><p>If DNS-01 is not an option or to complicated, this saves you from exposing a host to the internet for no good reason.
评论 #37487233 未加载
coldbluesover 1 year ago
The most hassle free way to reverse proxy with Docker. I love it.
mooredsover 1 year ago
Big fan of caddy. We use it internally and our company provides financial support to the developers.
评论 #37481603 未加载
lagniappeover 1 year ago
Maybe first but not the only! <a href="https:&#x2F;&#x2F;github.com&#x2F;donuts-are-good&#x2F;appserve">https:&#x2F;&#x2F;github.com&#x2F;donuts-are-good&#x2F;appserve</a>
评论 #37483854 未加载
评论 #37481592 未加载
TimCTRLover 1 year ago
&gt;All hostnames (domain names) qualify for fully-managed certificates if they:<p>-are non-empty<p>-consist only of alphanumerics, hyphens, dots, and wildcard (*)<p>-do not start or end with a dot (RFC 1034)<p>Someone help me understand this part...didn&#x27;t know this
评论 #37482566 未加载
hn92726819over 1 year ago
Caddy is great. My only complaint is they insist on sending a:<p><pre><code> Server: caddy </code></pre> Header that is impossible to turn off since it&#x27;s hardcoded here: <a href="https:&#x2F;&#x2F;github.com&#x2F;caddyserver&#x2F;caddy&#x2F;blob&#x2F;master&#x2F;modules&#x2F;caddyhttp&#x2F;server.go#L260">https:&#x2F;&#x2F;github.com&#x2F;caddyserver&#x2F;caddy&#x2F;blob&#x2F;master&#x2F;modules&#x2F;cad...</a><p>The developer&#x27;s annoying response is &quot;it doesnt improve privacy or security, so we won&#x27;t give you the option to remove it&quot;.
评论 #37481571 未加载
评论 #37481659 未加载
k_bxover 1 year ago
Just curious. I use Ubuntu on my servers (as many do) and I deploy everything as standard Systemd service (even my apps). However, when I wanted to try out Caddy, I realized they don&#x27;t provide you with one, so you have to write your own scripts putting systemd config files, enabling the service etc. Is this what everyone does these days? Seemed kinda strange for mainstream software.
评论 #37482283 未加载
评论 #37480796 未加载
ttyyzzover 1 year ago
I love Caddy, using it as a Reverse proxy (even in docker) is so nice and easy. All you need is 2 lines of config:<p>:2080<p>reverse_proxy :9000
评论 #37478404 未加载
评论 #37481361 未加载
评论 #37479057 未加载
hackerbrotherover 1 year ago
Easiest way to use HTTP&#x2F;3!!
lessnameover 1 year ago
How does Caddy compare to Nginx Unit? Is the API easier to use?
评论 #37480033 未加载