Question
How a combination of Apache and nginx in proxy mode works in Plesk for Linux?
Answer
When website URL is opened in browser what happens is as follows:
- Client request comes to front end Nginx asking for some resource (.html page, .php page, image, javascript, etc). Nginx in Plesk works on TCP ports: 80 – http, 443 – https.
- Nginx checks if it has the resource already in its cache.
- If the resource is cached, Nginx returns the cached content.
- If the resource is not cached or if dynamic page (e.g. index.php) is requested , Nginx proxies (forwards) the request to back end server – Apache. Apache in Plesk works on TCP ports: 7080 – http, 7081 – https. Then Nginx caches static content – html, images, js, css.Â