Caddy – Open-source web server with automatic HTTPS
In my eyes, Caddy is a lovely web server that works pretty well as ingress for container clusters (e.g. Nomad, Docker Swarm etc.). That said, i can&#x27;t help but to feel that v1 was easier and in some ways nicer to use than v2, even though it&#x27;s abandoned at this point.<p>That said, i have certain grievances with most of the web servers out there.<p>Apache2&#x2F;httpd - actually decently usable even nowadays, but if the fragmentation of service names (httpd vs apache2, with additional scripts like a2enmod) between different distros doesn&#x27;t hurt it, then the configuration format and how it does reverse proxying and path rewriting most certainly will. The performance is still passable, no matter what anyone says, my applications still have been the bottleneck in approx. 95% of the cases, though that might change with frameworks like Vert.X or such. The further down you scroll, the less user friendly it becomes: <a href="https:&#x2F;&#x2F;httpd.apache.org&#x2F;docs&#x2F;2.4&#x2F;rewrite&#x2F;remapping.html" rel="nofollow">https:&#x2F;&#x2F;httpd.apache.org&#x2F;docs&#x2F;2.4&#x2F;rewrite&#x2F;remapping.html</a> Admittedly, the docs themselves are good, though, despite the syntax that you&#x27;re stuck with.<p>Nginx - recently migrated my ingress to it at work, seems pretty okay so far, the configuration format seems to make a bit more sense and probably lies somewhere between Apache and Caddy as far as its ease of use and pleasantness goes. I no longer even need rewrite rules to get websockets working properly, which is nice. And my containers can have all of the necessary config in a single file vs the unnecessary boilerplate fragmentation that httpd forces upon me. For example, both of these seem more passable to me when compared to Apache2: <a href="https:&#x2F;&#x2F;docs.nginx.com&#x2F;nginx&#x2F;admin-guide&#x2F;web-server&#x2F;reverse-proxy&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.nginx.com&#x2F;nginx&#x2F;admin-guide&#x2F;web-server&#x2F;reverse-...</a> and <a href="https:&#x2F;&#x2F;www.nginx.com&#x2F;blog&#x2F;creating-nginx-rewrite-rules&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.nginx.com&#x2F;blog&#x2F;creating-nginx-rewrite-rules&#x2F;</a><p>Currently, my biggest gripe is that Nginx kills itself when it cannot resolve an upstream host, for example, while Docker containers are still starting, their health checks haven&#x27;t passed and therefore their DNS records also haven&#x27;t been created: <a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;42720618&#x2F;docker-nginx-stopped-emerg-11-host-not-found-in-upstream" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;42720618&#x2F;docker-nginx-st...</a> The worst part is that none of the suggested answers actually work for me, so i can&#x27;t have a single Nginx instance be in front of the development environment with about 20 containers, a few of those being down when Nginx is being restarted will not let many of them be used until the startup finishes. Unacceptable.<p>Caddy - as stated before, i liked v1 more than v2, though the project itself is pretty close to as good as a web server might get. What i don&#x27;t enjoy is them taking the old docs offline, merely letting you download an archive, nor am i a fan of the current docs, since at the current point in time they are a bit like running &quot;tar --usage&quot;: <a href="https:&#x2F;&#x2F;caddyserver.com&#x2F;docs&#x2F;caddyfile&#x2F;directives&#x2F;reverse_proxy" rel="nofollow">https:&#x2F;&#x2F;caddyserver.com&#x2F;docs&#x2F;caddyfile&#x2F;directives&#x2F;reverse_pr...</a><p>It&#x27;s nice that there are a few examples for the common use cases, but there probably could be even more, just look at what the PHP documentation has at the bottom for a good example: <a href="https:&#x2F;&#x2F;www.php.net&#x2F;manual&#x2F;en&#x2F;function.str-replace.php" rel="nofollow">https:&#x2F;&#x2F;www.php.net&#x2F;manual&#x2F;en&#x2F;function.str-replace.php</a> (crowd sourced, but i like the idea of letting the community contribute useful information like that).<p>Apart from that, some of the behavior is weird and you will get a 200 when you&#x27;d expect to get a 502&#x2F;404 in most other web servers: <a href="https:&#x2F;&#x2F;caddy.community&#x2F;t&#x2F;why-does-caddy-return-an-empty-200-response-for-a-non-configured-host&#x2F;7685" rel="nofollow">https:&#x2F;&#x2F;caddy.community&#x2F;t&#x2F;why-does-caddy-return-an-empty-200...</a> which will sometimes be misleading (&quot;Huh, i&#x27;m not getting any data in the response to my request, even though the status is 200 in my log, weird...&quot;)<p>Also, i remember when v1 had this &quot;fail-fast&quot; habit of shutting down the entire server when renewing&#x2F;obtaining a certificate failed, something that i utterly hate when web servers do: <a href="https:&#x2F;&#x2F;github.com&#x2F;caddyserver&#x2F;caddy&#x2F;issues&#x2F;642" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;caddyserver&#x2F;caddy&#x2F;issues&#x2F;642</a> Admittedly, things are a bit better now: <a href="https:&#x2F;&#x2F;caddyserver.com&#x2F;docs&#x2F;automatic-https#errors" rel="nofollow">https:&#x2F;&#x2F;caddyserver.com&#x2F;docs&#x2F;automatic-https#errors</a> I just don&#x27;t understand why web servers can be so opinionated about these things and not provide something like &quot;failure_action&quot; in Docker Compose (<a href="https:&#x2F;&#x2F;docs.docker.com&#x2F;compose&#x2F;compose-file&#x2F;compose-file-v3&#x2F;#update_config" rel="nofollow">https:&#x2F;&#x2F;docs.docker.com&#x2F;compose&#x2F;compose-file&#x2F;compose-file-v3...</a>) so that people can choose between either stopping everything as soon as problems manifest, or continuing with a &quot;best effort&quot; strategy.<p>If i&#x27;m hosting 100 sites behind a reverse proxy, i don&#x27;t want 99 to be taken down just because 1 of them was misconfigured, the web server should be able to throw out a warning about that one host if i tell it to, and proceed to run the rest 99 as instructed. When no web server forces me to cope with such brittleness will be a good day.