Hestia with Varnish

Try dragonfly its supposed to be 25x faster than redis GitHub - dragonflydb/dragonfly: A modern replacement for Redis and Memcached

1 Like

Finally got it. Magento 2.4.4 , php 8.1.6, elasticsearch 7.17.3, composer 2.x, nginx 1.21.6, mariadb 10.,5.16 and Varnish 7.0.2 working flawlessly with HestiaCP.

For those interested, I’ll post a How-To-Guide here on the HestiaCP forum.

Thanks to those in the thread that offered their advice and assistance. :slight_smile:

4 Likes

Nice one! :smiley:

Out of curiosity, did you consider dragonfly as @liamgibbins suggested?

This is awesome! I am very happy to read that you finally pulled it off. I am very interested in getting a better ttfb too please don’t forget to share.

1 Like

I am also very interested, can not wait for your guide

1 Like

I also have Varnish working on Hestia now. You just need to copy the default.tpl and default.stpl files in /usr/local/hestia/data/templates/web/nginx/ as varnish.tpl and varnish.stpl, changing the proxy_pass http://%ip%:%web_port%; to proxy_pass http://%ip%:6081; and proxy_pass https://%ip%:%web_ssl_port%; to proxy_pass http://%ip%:6081; while setting the IP and Port in Varnish’s default.vcl to your local IP and 8080.

This puts Varnish between Nginx and Apache, allowing Nginx to do the SSL offloading you’re expecting and Varnish to do the caching.

2 Likes

@jearle That is great! I’ve done it in a similar way but with Nginx and without Apache.

Are you forwarding the actual IP of the web site user to your logs, replacing the internal server IP?

This is what I’m working on now. We need the actual customer’s IP which can be forwarded through Nginx, and was wondering if you’ve dealt with this yet.

Yes, in Nginx, realip

EDIT:

I added the following:

set_real_ip_from X.X.X.X;    (where X.X.X.X is your server IP)
real_ip_header X-Real-IP;
real_ip_recursive on;

Added the above to /etc/nginx/nginx.conf and we’re passing customer’s IPs. :tada:

Great work, Thanks everyone! Can someone create a full guide for this?

The same thing happened to me and if you do a check it tells you that port 80 is still busy. I changed the configs of each domain to 8080 rebuild and it worked for me

1 Like