Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

What does nginx for plesk actually do?


Asked by Madilynn Cherry on Dec 08, 2021 Nginx Getting started



Nginx in Plesk works as reverse proxy in front of Apache. Nginx is used for Cache static files (HTML, CSS), Proxy dynamic content (PHP, etc). It is efficient for multiple and slow (i.e. mobile devices) connections (low RAM). Nginx allows to reduce lifetime of Apache processes, thus lower Apache RAM consuming.
Keeping this in consideration,
To seamlessly integrate nginx with Apache, Plesk uses two additional Apache modules: mod_aclr2 This module sets up a handler which runs after handlers of all other Apache modules (mod_rewrite, .htaccess related modules, mod_php, and so on).
Thereof, This means that nginx becomes a frontend web server that processes all incoming requests from site visitors. The requests are sent to Apache which, in turn, distinguishes requests for static and dynamic content.
Besides,
Another advantage of this web server compared with Apache is that nginx has a significantly smaller memory footprint per client connection. To leverage all the benefits of nginx, Plesk configures it as a reverse proxy server that stands between the Internet and Apache (see the diagram below).
Moreover,
NGINX utilizes an asynchronous event-driven model, delivering reliable performance under significant loads. This web server hands dynamic content off to FastCGI, CGI, or alternative servers (including Apache), before it’s sent back to NGINX for delivery to clients.