Nginx is said to be much more resource-efficient and easier to configure than Apache. A friend told me that "it can't do some things that Apache can do, but I don't need those things anyway."
Still, I'm curious: what kinds of things can Apache do that Nginx can't? I don't need an exhaustive list, just a general idea of scenarios where Apache would be a better choice.
I think the biggest pieces still missing from Nginx is full WebDAV support. Pretty much every other aspect is covered by either the core or a 3rd party module.
Nginx does not support things like mod_php by design, so I'm not sure you can say that Nginx is missing these parts. It's more like Nginx is telling you rather forcefully that using this is stupid.
Apache has a great amount of modules available which allow for some deployment scenarios which are not possible with Nginx.
One example is
mod_dav_svn
for hosting Subversion over HTTP. It is only available for Apache. Other notable examples are things likemod_perl
ormod_php
. While most traditional setups can also be done via FCGI (or WSGI, or passenger), having an actual interpreter in-process can be beneficial if you need to e.g. implement custom authentication schemes inside the webserver (like it's done for git or svn hosting with Redmine/ChiliProject).Generally, your friend is right: most common deployment scenarios can also be solved with nginx, but Apache still is more flexible if you have to build some more "special" stuff.
The short version of the story is that Apache has a lot of plugins and community built up around it. Nginx, has only been around for a short time comparatively, and so it doesn't have the community code base yet.
When people ask me what the difference is, Nginx is a steak knife, it's good for a variety of uses and does some things extremely well. Apache is a Swiss Army Knife, it's got a ton of different features and does all of them reasonably well.
Many modules and a ginourmous installed base, for start. But it's not exactly what Apache has that you should be looking at, is what Apache does: it works way better to serve dynamic content like PHP, Python, Perl, Java, etc.
Of course you can do that with Nginx too (but it's a little hackish IMHO), but the solutions are way more proven and mature running on Apache than on NginX, that on its turn is way better than Apache on serving high loads and a superb rewriter/reverse proxy.
For each job, the right tool!