
Nginx has replaced Apache as the most used web server among the top 10,000 sites - MarionG
http://w3techs.com/technologies/cross/web_server/ranking
======
dtech
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)

~~~
yuchi
Nginx is used as a reverse proxy for less strong application servers. IMHO
(and experience) doing it for Apache would be pretty useless.

~~~
jamescun
Depends heavily on how you have configured Apache. If you are using something
like PHP and the forking model (most common MPM configuration), you can only
handle as many requests as you have workers; additionally you are spinning up
a full PHP interpreter when serving static assets. In my experience[1],
putting Nginx in front of Apache to serve static assets and leaving Apache as
a sort of application server is one of the lowest hanging fruit in scaling a
LAMP application.

[1] Was Co-Founder/CTO of a medium-sized PHP PaaS company

~~~
y0ghur7_xxx
> additionally you are spinning up a full PHP interpreter when serving static
> assets.

I think that if you do this you are one RewriteRule away from doing it right.

> In my experience[1], putting Nginx in front of Apache to serve static assets
> and leaving Apache as a sort of application server

I also think that using nginx only for static content is wasting perfectly
good resources for nothing. Apache can serve static assets just as good as
nginx does. No need for an other layer in your stack.

------
guardian5x
There are different statistics with different methods and outcomes. For
example the netcraft server survey over 975,262,468 sites shows a market share
of Apache: 37.58%, IIS 33.41%, nginx 14.60%. Source:
[http://news.netcraft.com/archives/category/web-server-
survey...](http://news.netcraft.com/archives/category/web-server-survey/)

------
smoyer
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
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.

------
saltcod
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!

~~~
Theodores
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.

~~~
saltcod
Cool! I never thought of that!

Will it be noticeably faster than my current (tuned) Apache setup?

~~~
Theodores
Nginx is faster, however, it is possible to get Apache to be quick and it is
possible to make nginx slow (I think 'if' statements are to be avoided in the
config).

However, as well as speed there is also the amount of load that can be
sustained. Nginx wins on this front as well as with speed.

As mentioned, run it on another port and see for yourself. When you are happy
with it turn off apache on the chkconfig, set nginx to the other port, stop
apache and run nginx -s reload to swap over the port. Yep, you can get the
whole thing installed, tested and deployed without reboot or downtime!

------
troymc
"We didn't get the answer we wanted."

"Then reduce the sample size!"

------
manishsharan
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
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?

~~~
manishsharan
Stuck on Mod_jk and AJP ? I feel your pain ; and I fled from it a long long
time ago.

You don't need AJP with NGINX; this enables you to easily work with any J2EE
app server or web server . I ran into issues with configuring glassfish with
Apache and thus began using NGINX. Why bother with AJP ?

Yes setting up NGIX as a reverse proxy for Tomcat/ Glasshfish whatever is very
simple. Setp a NGINX on your desktop and you will never have to connect to
port 8080 ever again. Also it can serve static content while lettting your app
server handle application urls.

------
dreen
can someone link up a good "nginx for newbies" type resource for someone who
is familiar with programming?

~~~
mfjordvald
I hope it's kosher that I link my own blog since it deals specifically with
nginx: [http://blog.martinfjordvald.com/2010/07/nginx-
primer/](http://blog.martinfjordvald.com/2010/07/nginx-primer/)

~~~
vegardx
This is one of the best primers you get for getting started with Nginx, and
mfjordvald is a genuinely nice and helpful guy!

------
gjvc
i note postfix usurped sendmail much faster.

~~~
nailer
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.

~~~
nailer
Replying to myself: s/uninstallable/unremovable/. Though everyone seems to
have got what I meant.

------
Mitranim
Curious how Node isn’t even mentioned. Interesting how many years until it
catches up.

~~~
letney
Probably never. As any site in the top rankings is likely going to be using
nginx as a reverse proxy to node.js.

------
coherentpony
How can I tell, by visiting a site, what web server is being used?

~~~
filenox
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/](http://ycombinator.com/)

~~~
coherentpony
Oh wow, that's cool. I didn't know that. Thanks.

~~~
astrodust
For a laugh do it on [http://www.reddit.com/](http://www.reddit.com/)

~~~
coherentpony
I get this:

    
    
        $ curl -I www.reddit.com
        HTTP/1.1 200 OK
        Content-Type: text/html; charset=UTF-8
        x-frame-options: SAMEORIGIN
        x-content-type-options: nosniff
        x-xss-protection: 1; mode=block
        Server: '; DROP TABLE servertypes; --
        Date: Mon, 26 May 2014 18:37:12 GMT
        Connection: keep-alive
        Vary: accept-encoding

------
jqm
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
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.

~~~
pjbrunet
Hypothetically, a company like Hyperspin could create a chart of webservers
that were offline (most likely to break) in the past X days. I think the
results would be interesting. Example: Out of 1,234 servers that were offline
for > 1 hour in the last month, 40% Microsoft, 30% Apache, 20% NginX, etc.

~~~
pjbrunet
I assume the too-shy-to-reply downvoter thinks downtime is not a direct
correlation to a problem with the webserver. While that's true, I was hoping
to argue that the stack chosen is indicative of deeper problems such as stack
complexity. A too-complex stack is more prone to break, which is part of the
appeal of NginX, its simplicity. You could also prove Microsoft stacks are
more or less likely to fail. For example .01% of Microsoft servers were
offline last month, .009% of Apache servers were offline (> 1 hour) last
month, etc. PS: If it wasn't obvious, I made up hypothetical percentages.

~~~
jqm
some people are a bit too free with downvotes.

I can only imagine what these people are like in real life. I suppose
aggression is necessary part of the human condition and that saddens me.
But... hey, if it makes one feel powerful to down vote, go ahead. Personally I
find it cowardly unless the person can take a second to explain why but
whatever.... (Exceptions made for blatant cases of trolling and drop dead
stupid comments of which yours was not one... and I appreciate the support.
Thanks. PS. fellow UF alum! Looks like I graduated the year you started.).

~~~
pjbrunet
Go Gators ;-) As long as we're off on a tangent, this made me realize
downvotes here are (pretty much) anonymous, but comments are not. I think it
would be interesting if anonymous notes could be attached to downvotes. It
would also be interesting if those anonymous notes were either public or
private. So hypothetically, if you had 10 downvotes, you could hover that and
read why people downvoted. Another approach (I like this idea better) the
downvote could trigger a menu of tags like [Nonsense] [Rude] [Grammar] etc.
Anonymous or not, constructive criticism is a good thing, in my opinion.

~~~
jqm
That's a good idea. Anonymous notes on a downvote. Hope to keep seeing you
post on here. Gainesville seems like a million years ago and it was a great
time.

------
reboog711
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
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%.

~~~
reboog711
I see now; I didn't notice the distinction in the subject header here.

