NGINX Reverse Proxy configuration and static content
Hello,
I have followed the cPanel process for installing and configuring NGINX Reverse Proxy with Caching enabled so as to work in front of Apache.
In an attempt to improve TTFB, I have the following questions:
1. Should I configure NGINX so as to server static content (such as images) directly, and not via Apache? My static content is gathered under a specific directory of the document root directory.
2. If the NGINX is configured to server static content (such as images) directly, and not via Apache, will NGINX also cache the static content?
-
Hey there!
1 - Making that type of configuration change would be done outside of the cPanel tools, so I wouldn't recommend doing that. cPanel only supports Nginx when it is reverse-proxying data to Apache. In our guide at https://docs.cpanel.net/knowledge-base/web-services/nginx-with-reverse-proxy/ we mention "If you do not want to proxy all of your content through Apache, you can use our standalone version of NGINX"
2 - Since this isn't something we test I can't say for sure. I would assume the answer is "yes" since at https://docs.cpanel.net/knowledge-base/experimental-software/nginx-standalone/ we say the following: "This document explains how to install NGINX Standalone on a server that runs cPanel & WHM and EasyApache 4. NGINX is an open source web server that also provides a reverse proxy, load balancing, and caching. It functions very differently from Apache®. NGINX does not serve dynamic content unless you pass it through a proxy."
Our standalone version of Nginx is still experimental, so it's not something we officially support.
0
Please sign in to leave a comment.
Comments
1 comment