This question came in my mind when I noticed that Hashnode is using Caddy Web Server. I was wondering weather the reason for using it is that, they provide HTTP/2 web server with automatic HTTPS or simply because it is more reliable than Nginx ?
One More question!
Is Hashnode willing to pivot from Node.js to Golang in future?
Hashnode is a community of independent bloggers where everyone has the liberty to bring their domain and own their content. In other words, we are building a multi-tenant app and need a solution that can help us generate and serve SSL certs on demand. nginx doesn't support this by default. So, we went with a different approach which involves using OpenResty and Lua:
However, after 50+ custom domains, the SSL handshakes started getting slower. On average, it took ~1s for the SSL negotiation to complete which is completely unacceptable. Also, OpenResty (used it with lua-resty-auto-ssl plugin) used to crash when it couldn't generate SSL cert successfully - this was completely random though.
I raised an issue on GitHub, but didn't receive any response: github.com/GUI/lua-resty-auto-ssl/issues/178
The maintainers might not have the bandwidth to maintain it actively and address the issues -- I totally understand that.
After that, I started re-evaluating different solutions and Caddy seemed to be a perfect fit. It supports:
Additionally, their team is trying to build a real business out of it and we can get support from them if we ever decide to do so. So, Caddy is the right solution for our use-case and therefore we switched.
Is Hashnode willing to pivot from Node.js to Golang in future?
No. We'll stick to Node.js. Although Go is a great language, we don't think it's necessary to switch to Go. You can use Caddy with any backend. :)
Not answering for HashNode. But I have used both. Nginx has been there for a long time, its more robust, battle tested and being used for huge production work loads. The pain point I saw in Nginx is configuring it, I had to spend most of my time on configuration. If someone new had to alter the existing configs, they will take long time. I have heard people saying Nginx is faster than Caddy, of course it should be it's been there for 15 odd years.
On other hand caddy is light weight, less complex than Nginx, single binary file. It's also being rapidly adopted into production these days. The main advantage of caddy is that you don't have to focus on installation/configuration you can bring up an HTTPS server in 10 seconds with few lines of config file. On scaling part, I have not seen any hiccups with Caddy so far. But others opinion might vary.
Another advantage of caddy is you can embed it into your Golang code base, that is instead of using it as stand alone webserver you can import the webserver as a library. You can check my blog post on this:)
TLDR; if you want simpler, robust, lighter, out of the box HTTPS web server go for Caddy. If you want more robust, enterprisey webserver you can go for Nginx.