Need advice about which tool to choose?Ask the StackShare community!
nginx vs Varnish: What are the differences?
nginx: A high performance free open source web server powering busiest sites on the Internet. nginx [engine x] is an HTTP and reverse proxy server, as well as a mail proxy server, written by Igor Sysoev. According to Netcraft nginx served or proxied 30.46% of the top million busiest sites in Jan 2018; Varnish: High-performance HTTP accelerator. Varnish Cache is a web application accelerator also known as a caching HTTP reverse proxy. You install it in front of any server that speaks HTTP and configure it to cache the contents. Varnish Cache is really, really fast. It typically speeds up delivery with a factor of 300 - 1000x, depending on your architecture.
nginx belongs to "Web Servers" category of the tech stack, while Varnish can be primarily classified under "Web Cache".
"High-performance http server", "Performance" and "Easy to configure" are the key factors why developers consider nginx; whereas "High-performance", "Very Fast" and "Very Stable" are the primary reasons why Varnish is favored.
nginx and Varnish are both open source tools. nginx with 9.11K GitHub stars and 3.44K forks on GitHub appears to be more popular than Varnish with 908 GitHub stars and 216 GitHub forks.
According to the StackShare community, nginx has a broader approval, being mentioned in 8676 company stacks & 2560 developers stacks; compared to Varnish, which is listed in 1006 company stacks and 140 developer stacks.
I am diving into web development, both front and back end. I feel comfortable with administration, scripting and moderate coding in bash, Python and C++, but I am also a Windows fan (i love inner conflict). What are the votes on web servers? IIS is expensive and restrictive (has Windows adoption of open source changed this?) Apache has the history but seems to be at the root of most of my Infosec issues, and I know nothing about nginx (is it too new to rely on?). And no, I don't know what I want to do on the web explicitly, but hosting and data storage (both cloud and tape) are possibilities. Ready, aim fire!

I would pick nginx over both IIS and Apace HTTP Server any day. Combine it with docker, and as you grow maybe even traefik, and you'll have a really flexible solution for serving http content where you can take sites and projects up and down without effort, easily move it between systems and dont have to handle any dependencies on your actual local machine.
From a StackShare Community member: "We are a LAMP shop currently focused on improving web performance for our customers. We have made many front-end optimizations and now we are considering replacing Apache with nginx. I was wondering if others saw a noticeable performance gain or any other benefits by switching."

I use nginx because it is very light weight. Where Apache tries to include everything in the web server, nginx opts to have external programs/facilities take care of that so the web server can focus on efficiently serving web pages. While this can seem inefficient, it limits the number of new bugs found in the web server, which is the element that faces the client most directly.

I use nginx because its more flexible and easy to configure

I use Apache HTTP Server because it's intuitive, comprehensive, well-documented, and just works
Pros of NGINX
- High-performance http server1.4K
- Performance893
- Easy to configure727
- Open source606
- Load balancer529
- Scalability287
- Free286
- Web server223
- Simplicity174
- Easy setup135
- Content caching29
- Web Accelerator20
- Capability14
- Fast13
- High-latency11
- Predictability11
- Reverse Proxy7
- Supports http/26
- The best of them5
- Great Community4
- Lots of Modules4
- Enterprise version4
- High perfomance proxy server3
- Embedded Lua scripting3
- Reversy Proxy3
- Streaming media delivery3
- Streaming media3
- Fast and easy to set up2
- Slim2
- Blash2
- Lightweight2
- saltstack2
- Virtual hosting1
- Along with Redis Cache its the Most superior1
- Ingress controller1
- Narrow focus. Easy to configure. Fast1
- GRPC-Web1
Pros of Varnish
- High-performance103
- Very Fast66
- Very Stable56
- Very Robust43
- HTTP reverse proxy36
- Open Source20
- Web application accelerator17
- Easy to config10
- Widely Used4
- Great community3
- Essential software for HTTP1
Sign up to add or upvote prosMake informed product decisions
Cons of NGINX
- Advanced features require subscription8