Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento with SSL + Varnish

I want to use Varnish on our Magento store to make it faster. We run CentOS 6.6 with DirectAdmin.

But our entire store always loads on a https connection.

What is the best way to install varnish for our store with SSL?

like image 965
JGeer Avatar asked Jun 08 '15 15:06

JGeer


2 Answers

There are a few possibilities. If you have only one server the best way is to install SSL on a NginX and forward the terminated request to Varnish. Varnish can cache the result from the "backend" and deliver them directly to NginX. In most cases you have a Loadbalancer before your setup witch makes the SSL termination and redirect them to varnish.

But you have to be patient, then a lot of sites in a shop can't be cashed because there are dynamic forms.

Here is a good extension to get Varnish work with Magento.

http://www.magentocommerce.com/magento-connect/pagecache-powered-by-varnish.html

And here is a good tutorial for SSL:

https://www.digitalocean.com/community/tutorials/how-to-configure-varnish-cache-4-0-with-ssl-termination-on-ubuntu-14-04

like image 70
René Höhle Avatar answered Oct 13 '22 14:10

René Höhle


Varnish server setup for magento.

sudo nano /etc/default/varnish

Default configuration replace from

DAEMON_OPTS="-a :6081 \
-T localhost:6082 \
-f /etc/varnish/default.vcl \
-S /etc/varnish/secret \
-s malloc,256m"

To

DAEMON_OPTS="-a :80 \
             -T localhost:6082 \
             -f /etc/varnish/default.vcl \
             -S /etc/varnish/secret \
             -s malloc,1024m"

Check default.vcl file port

nano /etc/varnish/default.vcl

Output-:

backend default {
.host = "127.0.0.1";
.port = "8080";
}

Configure the nginx.conf to listen port 8080.

For More details See My Article Install Magento2 on Ubuntu (Nginx, Mysql-Server, PHP5.6, Varnish Cache)

like image 28
Arvind Kumar Rawat Avatar answered Oct 13 '22 14:10

Arvind Kumar Rawat