* You are probably not Google and the http/https server is almost certainly not a performance problem worth worrying about.
Pro-Apache:
* Swiss army knife. At my day job we use a pile of Apache modules; if we went nginx we'd have to replace these with a kitchen drawer full of standalone gadgets.
* You know Apache well.
* Lots of LAMP apps pretty much presume Apache (WordPress plugins in particular) and nginx support is a me-too.
Pro-nginx:
* Smaller and cleaner config.
* You know nginx well.
* nginx support is getting better, if you like nginx it's worth checking your prospective application.
Honestly, for almost all use cases it probably doesn't matter which. Pick whatever makes you most effective.
Fixed in Plus, not in the open source product.
And unless you support it solidly and long-term, nobody would really use it: paid support from Ngnix is much less risk.
If you have an existing configuration written in any, it invariably ended up as a pile of hacks, domains and misredirections that is a pain to rewrite for the other. That makes it hard to change.
Apache has support for some modules, mostly for authentication, that nginx doesn't have.
Old applications, like wordpress, are only supported and documented on Apache.
Wordpress is not old, it is just very badly written.
Not true: https://codex.wordpress.org/Nginx
I've been using WordPress on Nginx for almost a decade now, I just found that bit funny given the context.
WordPress itself is fine. Many plugins, however, assume Apache (and MySQL).
"Come for the performance, stay for the configuration".
www.example.com/widgets.html
and this address without the file extension will work: www.example.com/widgets
If the file is widgets.php or some other language that Apache considers a script, then even this will work: www.example.com/widgets/1234
and $_SERVER['PATH_INFO'] will be set to /1234.This is all turned on with one line in a configuration file:
Options +MultiViews
instead of having to turn on mod_rewrite, with its complexity.Nginx and Apache are about the same performance, assuming you are on 2.4.x and using the latest apr/apr-util/apr-iconv. The memory footprint is about the same and benchmarks are about the same.
Nginx still hard codes libc options that I have to undo in the Makefile each time to get the glibc hardening options enabled. (PIE, Full RELRO, stack protector and so on) I have not tested the last 3 or so releases, so maybe Maxim has resolved this?
I prefer Apache for anything CGI related, as the security is more tightly coupled to the webserver. With NGINX, I have to use another daemon that has it's own security settings, environment, etc.
With .htaccess files turned off (AllowOverride None), I got 282 requests per second. With .htacess files on (AllowOverride All) I got 286 requests per second (Yes, actually a few more hits per second with .htaccess turned on, but the results swing from test to test by a few percent anyway).