3 ms·
Granted I've done exactly this before, but why put Nginx in front of Apache? In my experience it added headaches without any real benefit. (Unless you don't me
by nkozyra 5y ago
Granted I've done exactly this before, but why put Nginx in front of Apache? In my experience it added headaches without any real benefit.
(Unless you don't mean Apache webserver but rather some other Apache product)
- tinus_hn 5y agoI have done this to host multiple services (running using multiple users and setups) from one host.
- singron 5y agoNginx manages a ton of connections better and can serve static files very fast. It can then multiplex the dynamic requests into fewer connections to Apache. If you mean why not only use nginx, I would guess that's easier than changing your legacy systems to use nginx (e.g. if you have a ton of htaccess files). It's also possible you got better performance with mod_php although most people seem to claim that php-fpm with nginx is faster.
- nkozyra 5y ago> If you mean why not only use nginx Yes, this is what I meant. I originally wrote a SaaS app that was hosted through Apache and ended up putting NGINX on top of it for the aforementioned reasons. But eventually testing showed that removing Apache just made the whole thing a whole lot more manageable. I have friends with similar anecdotes. Just putting NGINX in front from the get-go would have saved a lot of tech debt.
- realityking 5y ago2012-2015 I worked at a shared hosting company and towards the end of my tenure there we revamped the architecture to be centered on nginx (SSL termination, HTTP2 support, etc.) and invested quite a bit in API and GUI support for rewrite rules, redirects, etc. However, for better or worse, a lot of the software people want to run on shared hosting come with a .htaccess file and documentation for how to configure it otherwise. So we gave customers a choice to put Apache behind nginx. Unfortunately I left too early to learn what %age of customers ended up enabling Apache but they‘re still running this architecture today.