top | item 7799261

Nginx has replaced Apache as the most used web server among the top 10,000 sites

274 points| MarionG | 11 years ago |w3techs.com

75 comments

order
[+] dtech|11 years ago|reply
Couldn't these results be skewed because Nginx is often used as a reverse proxy?

If there is Apache or something custom behind Nginx it will show up as Nginx I guess. I do not see this issue adressed and it might cause significant skew if you look at the top websites (since they will more often deploy these kinds of tricks)

[+] toni|11 years ago|reply
Isn't it considered best practice to serve your static files through Nginx itself and only reverse proxy requests for dynamic endpoints? And if that's the case, Shouldn't Nginx be counted as a full web server?
[+] thesnufkin|11 years ago|reply
Good point, or perhaps more used as the LB? We prefer Varnish as the reverse proxy, but we are using nginx as load balancer, which still shows up as the server in the response header, even though we exclusively run apache on the back-ends to serve the PHP application. I am not sure how typical this setup is though.
[+] bigdubs|11 years ago|reply
We use nginx as a load balancer on its own machine and distribute requests to a small farm of machines running windows/iis.

Nginx is great as a load balancer, not quite as sophisticated as HAProxy but the SSL support is good and it gets the job done pretty well.

I'm sure we're not the only ones.

[+] yuchi|11 years ago|reply
Nginx is used as a reverse proxy for less strong application servers. IMHO (and experience) doing it for Apache would be pretty useless.
[+] bowlofpetunias|11 years ago|reply
Exactly. I have much more Apache servers than Nginx, but you can't see most of those Apache instances from the outside.
[+] JimmaDaRustla|11 years ago|reply
You reverse because you can't have two apps on the same port, obviously...but the real reason is because apache's lack of features...and apache is bad!

Even if apache is running in the background to serve up things like php, its most likely because there is some config that hasn't been converted to run the site on something like fast-cgi or FPM.

I wonder how something like haproxy appears when nginx is behind it.

[+] smoyer|11 years ago|reply
I know this is off-topic but I'm also surprised by Google Server's popularity. Can 10% of the top 1000 web-sites really be serviced by Google? You've got to pay for the reports, but I wonder if people using Google's CDN for static assets could be skewing those results. Does anyone have insight into the methodology used to collect this data?
[+] babuskov|11 years ago|reply
They are probably counting each regional Google server as a separate "site" because it has a different hostname (different tld). There are easily 100 of those, esp. if YouTube counts as well.
[+] Kurtz79|11 years ago|reply
Wouldn't most of those be Google own websites ?

If we consider a separate www.google.x for each country then we would get to around 100 very quickly, I guess.

The remainder would be filled by youtube, gmail, etc...

[+] saltcod|11 years ago|reply
Any opinions on Nginx being more difficult to setup/run than Apache? I'm considering switching, but I really have enough overhead to deal with!
[+] mfjordvald|11 years ago|reply
I'm very biased on this subject but I find the configuration file to be far more simple. The lack of .htaccess support is also a blessing in disguise as everything is in explicitly defined locations.
[+] Theodores|11 years ago|reply
Just give it a go. Remember you can set it up to run on another port, e.g. 81, 8080 etc. so you can get it working whilst still having Apache up and running on your site.

For popular CMS applications you can normally find some helpful .conf file to get you started.

You will also need to setup php-fpm if you are running a PHP flavoured 'LAMP' stack.

[+] mercer|11 years ago|reply
If you have anything to do with Drupal (and possibly Wordpress) as well, you might run into issues.

At least concerning Drupal, a lot of plugins require changes to the .htaccess file(s), and at least when I tried, this was hard to translate to nginx.

But there are some .htaccess to nginx converters, so I'm not sure if that is a big issue at this time.

And as others have said, you might find the nginx approach to be much more comfortable than .htaccess. I did.

[+] Walkman|11 years ago|reply
Way easier to configure than apache!
[+] troymc|11 years ago|reply
"We didn't get the answer we wanted."

"Then reduce the sample size!"

[+] manishsharan|11 years ago|reply
We abandoned Apache as we found configuring Tomcat with Apache to be a major pain whereas configuring NGINX with Tomcat or other J2EE application servers is almost a no-brainer. Ditto with SSL termination. Since then we've moved all static file serving to NGINX as having both Apache and NGINX did not make sense. I know that a lot of other JVM shops did the same.
[+] olavgg|11 years ago|reply
How do you do this? Are just using a proxy?

I use mod_jk with Apache. With mod_jk you use the AJP protocol to communicate with Tomcat. It's one line in your Apache config and a few lines in /etc/libapache2-mod-jk/workers.properties (Debian)

Are there any support for AJP for Nginx today?

[+] dreen|11 years ago|reply
can someone link up a good "nginx for newbies" type resource for someone who is familiar with programming?
[+] gjvc|11 years ago|reply
i note postfix usurped sendmail much faster.
[+] nailer|11 years ago|reply
sendmail was genuinely terrible: monolithic, unused, uninstallable attack vectors everywhere (echoes of openssl), near-binary configuration which required learning a complex macro language. Even Sendmail X bears more resemblance to Postfix than it does to Sendmail 9.
[+] VMG|11 years ago|reply
funnily enough nginx also is a IMAP/POP3 proxy server
[+] Mitranim|11 years ago|reply
Curious how Node isn’t even mentioned. Interesting how many years until it catches up.
[+] letney|11 years ago|reply
Probably never. As any site in the top rankings is likely going to be using nginx as a reverse proxy to node.js.
[+] coherentpony|11 years ago|reply
How can I tell, by visiting a site, what web server is being used?
[+] filenox|11 years ago|reply
curl -I www.ycombinator.com

This gives you the HTTP Header, example output: HTTP/1.1 301 Moved Permanently Server: nginx Date: Mon, 26 May 2014 16:11:30 GMT Content-Type: text/html Content-Length: 178 Connection: keep-alive Location: http://ycombinator.com/

[+] Garbage|11 years ago|reply
Mostly just by looking at "server" header. For example, Hacker News has server header as cloudflare-nginx
[+] jqm|11 years ago|reply
Did anyone else pause when they read the title line...

"Usage of web servers broken down by ranking".

I'm picturing a graph of the most commonly broken web servers for half a second.

[+] jqm|11 years ago|reply
I'll take the downvotes as a "no we didn't, and we think you are trying to be funny".

But, I actually did read that for a half a second and think the phrase "broken down" can be done without. It doesn't add anything in my opinion, I know it is broken down (its a graph), the phrase is unnecessary, and it caused me at least to stumble mentally for half an instant.

[+] reboog711|11 years ago|reply
I'm confused by this title and the article here.

The graph in the linked shows that "Apache is used by 60.5% of all the websites." while nginx is at 20.7%...

How could these numbers possibly mean that nginx has replaced Apache as the most used web server? When is 60.5% more than 20.7%? IS it opposite day?

[+] wtetzner|11 years ago|reply
You need to look at the legend. For the top 10,000 websites, Apache is used by 39.1%, and nginx is used by 39.2%.