Integrate Varnish with NGINX for TLS termination
Hello,
I have used the NGINX Manager so as to activate the NGINX Reverse Proxy. The activation was made smoothly and everything is working as expected with Apache (listening on 81, 444 ports) and the NGINX Reverse Proxy (listening on 80, 443 ports).
I have also installed Varnish listening on port 6081. Varnish can be integrated with NGINX for TLS termination, as it does not support SSL. I can configure Varnish so as to send HTTP traffic to Apache. How can I configure NGINX so that the HTTP requests are sent to Varnish instead of Apache?
-
I can understand that Varnish is not officially supported by cPanel. However, my request is actually about the manner I could customize the configuration of NGINX Reverse Proxy in a way that I place Varnish between NGINX and Apache, as I need NGINX for the TLS termination of Varnish.
The below documentation says which files to create so as to customize the NGINX for specific domain, but I need more information about the specific directives I should place in the relevant custom configuration filr:
https://docs.cpanel.net/knowledge-base/nginx/customize-reverse-proxy-nginx-configurations/
0 -
Hey there! I don't have any official details I can add for this configuration, as I just don't know what would be required for this configuration.
I'm not sure that adding both Nginx and Varnish will offer any improvements over just one or the other, but you're welcome to test that and see if it does improve the speed of your particular environment, although adding a layer of complexity will also increase any future troubleshooting burden.
0 -
Hello,
Placing Varnish in front of Apache or NGINX web server is actually the way the Varnish works as an HTTP accelerator. In addition given that the freeware version of Varnish does not support SSL, it requires an additional web server for TLS termination. Most often the TLS termination of Varnish is achieved with NGINX Reverse Proxy. As a result, the setup Apache-Varnish-NGINX is very common for making websites faster. I have already setup Apache-NGINX Reverse Proxy with Caching enabled via the NGINX Manager offered by cPanel. So, what is left for me is to test whether the solution "Apache-Varnish-NGINX" is faster than the solution "Apache-NGINX Reverse Proxy with Caching enabled".
0
Please sign in to leave a comment.
Comments
3 comments