Skip to main content

Integrate Varnish with NGINX for TLS termination

Comments

3 comments

  • Dimitris Andrikopoulos

    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
  • cPRex Jurassic Moderator

    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
  • Dimitris Andrikopoulos

    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.