Alternatives to nginx

Most of you here might know how powerful is nginx and also how much can you achieve with something like nginx but have you ever thought of like nginx was released in 2004, How come is it still the fastest or is there something else
If you are here in this blog for sometime you might know that I like to see which one is best among performance and if you want to see all our permance based quests ranging from expressjs vs flask to almost all the frameworks in nodejs, Click Here
So, you know right I had this question in my mind as well like, Nginx has been released in 2004 and Apache was released in 90's. So abviously when the time passes new and better technology comes
Just like this, we evolve over time. It's funny though but it's so true.
Right! So my question was is there something is better than nginx at performance or better at adding multiple functionalities like caching, gzip, limiting and multiple functionalities without compiling the source code again and again in the case of nginx.
Now, I don't know if there's anything like that or is there something better than nginx. I want to find this out and I am also explaining you guys from the perspective of me.
I am not gonna bore you with facts that you can find online so easily and you might even know about some of the stuffs that we are gonna see about
But I will also say some stuffs that I like about and why do I like and advantages of it that you can understand from a co worker perspective
So, here in this post we will see mainly about three alternatives to nginx and as you might know nginx is a revese proxy and a web server that serves static content as well.
- HAProxy
- Lighttpd
- Microsoft IIS
So, keep in mind most of these things we use for reverse proxy and load balancing across microservices if you don't know what microservice is,
Microservices are an awesome thing, we divide an whole web app into small and micro apps that contains specific functionality.
Like in a chat app, we will divide it into two microservices, one is for the users, another is for the chats. If the users in the chat app started conversing mostly with your app then you might want to consider horizontally scaling your app but here's the catch when you use a normal architecture,
You will shard your database and also add the same whole codebase in an another server and load balance it.
But the problem is you will scale both users and the chats but you wanted to do it only for the chats. That's where the microservices comes into play you will basically only scale the things that you want by running another server with the chats microservices.
If you want to learn about microservices architecture then here is an udemy course, Click Here. Anyways though I don't like instructor but many people does. (It is not an affiliate link, I don't earn if you even buy it.)
Now, these reverse proxies like nginx and other alternatives behave as a load balancer by balancing the requests between both the servers for managing the load.
We have specified everything about these alternatives. let's get started.
HAProxy
HAProxy is an free and open sourced reverse proxy server but it was released in 2001 which means before even nginx is born
You can use this for TCP and HTTP based protocols and it was written in C and it is said to be fast and efficient.
Now who uses HAProxy, GoDaddy, GitHub, BitBucket, Stack Overflow, Reddit, Slack, Twitter, Tumblr. Oh my goodness that's an impressive list, because how big of network is all of these companies.
Now my only question here is, is it more performant than nginx? As you can see in the graph itself that nginx clearly beats both the HAProxy types

Why you might consider using HAProxy
If the reason that you want to use haproxy is for performance then you use nginx itself but if the reason is for others.
Here is why you might consider it.
- Provides a comprehensive list of 61 different metrics. See section 9 for a full list of available statistics
- The status page is much more detailed and user-friendly as compared to Nginx’s
- Easily able to integrate with third-party monitoring services (e.g. Datadog)
- IPV6, PROXY PROTOCOL, TRANSPARENT PROXY, SSL & SNI, HTTP2, API, LUA Scripting, RDP connection broker, Stick tables, multi-node session replication, DDOS & DOS protection...
Lighttpd
It is an open sourced web-server unlike the both haproxy and nginx (nginx is both reverse proxy and web server.) it cannot do reverse proxying and load balancing.
I included it in this list because of two reasons one lighttpd is a complete web server and nginx is also a web server but only serves static sites.
But lighttpd serves dynamic content and also runs php, python, perl, ruby and lua. These are the programming languages communities that uses lighttpd
You can choose this if youre using apache and you don't want to use php-fpm and then configure reverse proxy and stuff.
This is the best alternative to apache but in the case of nginx it justs an option that you may consider and beware you can't use it for load balancing
Microsoft IIS
The reason again that I included this one the list is because
- It is backed by one of the largest tech firms
- This is one of the best alternative to nginx in windows alone.
I am just coming to the point directly, nginx only provides partial support for windows and using nginx in a windows production level app is consider not a good practice.
So microsoft itself came up with this framework that you can use for the windows, they mention that you can use this from media streaming to web applications and it's easily scalable and it can handle demaing tasks.
What I would choose.
I might choose HAProxy, in case if i dislike nginx so much and the reason that I choose is because of its ability to be used with multiple third party features without having to compile the code base again and again.
That's such a relief but still I like nginx though but if you don't like nginx go for haproxy it even has monitoring dashboards.
Conclusion
That's all for today guys meet you tomorrow and if you like any of my content then join our discord server and we can talk and share our problems that we come across just like this.

That's so true honestly like when I open instagram or something this is how I feel like everytime and It is also funny.
The whole humor is really based on the suffering and pain if you think about it, all the stuffs that we take funny are ones about our suffering, That's enough for your mind to disturb you the whole weekend ;)
Anyways, Happy Hacking Guys!





