Nginx works with apache to improve website performance and is a front end web server.
When working together, apache will be assigned to another port to receive requests as it works as a back end web server, where Nginx works as a front end in port 80 instead.
When Nginx is disabled, apache will be the one to be the only web server working.
There will be trouble starting apache if both are listening to port 80 and can only be resolved by disabling and re-enabling Nginx from the Plesk web interface.
To enable or disable Nginx from the Plesk control panel, please follow the steps below:
Using Apache with Nginx and How it Works
All incoming requests are sent to Nginx who than forwards these requests to Apache. Apache then distinguishes the requests for static and dynamic content.
If one of the requests ends up being static such as a JPG, HTML etc, Apache will pass the request through all registered handlers and will send the location of the requested file in filesystem to Nginx as a response.nginx, this will then locate the file and will send it to the client.
If the request ends up being dynamic content such as .JS, or PHP script, Apache will execute the file and send the response to Nginx who will then deliver the response to the client.
Advantages of nginx.
-> The maximum number of concurrent connections to a website increases.
-> The consumption of server CPU and memory resources decreases.
-> Efficiency of serving visitors with slow connection speed (GPRS, EDGE, 3G, and so on) improves.
Nginx doesn’t consume much RAM when serving any type of requests whether singular or multiple but Apache will consume much more and will not free up RAM until the request is complete.
To use less RAM and optimise a server, you should consider using Nginx. If you wish to learn more about using Apached with Nginx, please refer to the Knowledge Base link below: