How Nginx and Apache benefit from each other
As we've seen in the previous chapters, Nginx works well as a reverse proxy to many modern web environments, such as Node.js and PHP, interfacing directly with those environments with no middleman in between. However, there are also many older technologies that focused on deep integration into Apache HTTPd, and removing Apache from the equation can be non-trivial.
If possible, removing Apache HTTPd is usually the desired approach, for the simple fact that it gives you fewer things to maintain and keep updated. However, given the immense amount of modules for Apache, it's impossible for all of them to be ported, so even if this is not possible, using Nginx and Apache together can still bring benefits for us.
The main purpose of setting up Nginx as a frontend server and giving Apache a backend role is to improve the serving speed. As we established, a lot of requests coming from clients are for static files, and static files are served much faster...