17 ms·
This is kind of a weird statistic to try to analyze. So many uses of nginx are just the act of putting an Apache/IIS/etc site behind nginx, so technically, both
by p49k 10y ago
This is kind of a weird statistic to try to analyze. So many uses of nginx are just the act of putting an Apache/IIS/etc site behind nginx, so technically, both servers still have market share but you only see nginx. It's just that nginx makes it so easy to do certain things, like supporting modern HTTPS, that you might as well add it to your stack rather than replace something.
- deleted 10y ago[deleted]
- Sir_Cmpwn 10y agoPeople do that? And it's widespread? I've never heard of this.
- jamroom 10y agohttps://www.nginx.com/resources/admin-guide/reverse-proxy/ https://www.nginx.com/resources/admin-guide/reverse-proxy/
- Sir_Cmpwn 10y agoI know you can reverse proxy, but I haven't heard of anyone reverse proxying to apache.
- nkozyra 10y agoIt's extraordinarily common but largely unnecessary.
- justbaker 10y agoI've done it and yeah don't do it.
- fgonzag 10y agoThat was the original way (at least the most common way) to do CGI. Nginx as a reverse proxy / load balancer / SSL terminator / static file server pointing to a backend running apache for mod_cgi or mod_fastcgi. And a lot of people would have both web servers running on the same server. You already have a web server, why do you need two?! Just pick one!
- ue_ 10y agoReverse proxying to Apache is still how I run my Perl CGI scripts. I'm not sure of a better way to do it that supports running multiple scripts.
- vidarh 10y agoI feel old now. It was nowhere near the original way - CGI predates Nginx by a decade. > why do you need two?! Just pick one! When they're good at different things.
- pwenzel 10y agoWebfaction has been doing it that way since roughly 2008, initially introduced as a way to speed up serving of static files. https://blog.webfaction.com/2008/12/a-little-holiday-present-10000-reqssec-with-nginx-2/ https://blog.webfaction.com/2008/12/a-little-holiday-present...
- lucideer 10y agoI'd say the most common use-case (particularly given the ubiquity of PHP on the web) is to support mod_php for people not wanting to move to php-fpm for whatever reason - often some weird legacy reason, or sometimes just familiarity and change overhead.
- vidarh 10y agoThere's a massive amount of Apache modules and installs of stuff that has various dependencies on Apache where it's simply not worthwhile to expend any effort to convert it to Nginx, but where it's worthwhile placing in Nginx in front if you prefer Nginx for things like caching, load balancing etc.
- ZephyrP 10y agoThis must be the single most common use of nginx, I'm totally blown away that someone as prolific as you has never heard of it.
- eloisant 10y agoNo, the most common use of nginx is to put it in front of rails/play/jee/whatever framework that doesn't ship with a full featured web server.
- jamiesonbecker 10y agoHA Proxy would be a better choice if the only goal is reverse proxying to another web sever; nginx excels at static files, uwsgi, stuff like that. Even the commercial/paid nginx Plus only comes close to what's already built into ha-proxy, which is totally open source.
- ag_47 10y agoAs someone younger who never really used Apache, I don't see any reason to do anything with it instead of Nginx. Other than supporting "legacy" setups, whats the point of Nginx load balancing Apache? Configuring nginx is just so much more intuitive.
- pram 10y agoProbably a lot of mod_* uses like PHP applications that haven't been migrated to php-fpm or something, and JBoss/Tomcat/Websphere/Weblogic websites. You of course can just proxy all of these things with nginx, but it's probably not worth it for most companies.
- developer2 10y agoPHP is definitely a huge chunk of the reason why nginx has taken over Apache. php-fpm with nginx is the defacto standard, and PHP is far more prevalent than a lot of people think. Apache's mod_php(X) vs. nginx+php-fpm isn't even a debate. If someone is currently using Apache+mod_php, they probably have a smaller product that will eventually have to switch to nginx+fpm in order to scale. While I imagine PHP is the single largest reason, other languages that support or expect the use of fastcgi are also very easy to configure with nginx, whereas I can count on one hand the number of businesses I've seen using Apache's mod_fcgid.
- Zachery 10y agoI'm probably about 2 years out of being bleeding edge, but php-fpm&nginx are far from defacto standard. At least when you look at how the web is being served at large, looking at cPanel/WHM. I don't believe cPanel/WHM even supports nginx yet as a standard option.
- developer2 10y agoNot to be disrespectful - I know that cPanel and similar have their place - but no real business that expects to have a presence is using cPanel or any other "easy setup".
- need2sleep 10y agoIndeed. This is hardly a legitimate statistics, how many sites sit behind CloudFlare/Sucuri/Incapsula IP's, which are always nginx reverse proxies. I don't think anything changed that much as of late, apart from more and more people adopting CloudFlare.
- chaoticsamuel 10y agoAgreed, I mean is a reverse proxy even a server? The number of people who use Nginx for load balancing is huge, so when they say people are switching to nginx from Node.JS, I'm just like: "Dude, I only use Nginx for my kubernetes ingress, with plenty of services behind using Node.JS rather than any monolithic everything server" So is my server Nginx, Kubernetes or Node.JS, or Python, or Java? :-/ I think this statistic is conceptually a little behind the times in some ways
- benaadams 10y agoNginx will overwrites your origin server headers https://trac.nginx.org/nginx/ticket/538 https://trac.nginx.org/nginx/ticket/538 so for these stats it would get picked up as nginx even though its only forwarding
- tyingq 10y agoIt's also probably undercounting Nginx, because Cloudflare uses Nginx, but returns the headers for whatever it's proxied to.
- benaadams 10y agoAnd nginx overwrites origin server headers; whereas most other gateways/reverse proxies don't https://trac.nginx.org/nginx/ticket/538 https://trac.nginx.org/nginx/ticket/538