Skip to main content
Added Apache config for SSL termination
Source Link
David Lambauer
  • 1.1k
  • 2
  • 9
  • 25

Varnish in the open source version does not support SSL termination. Therefore you have to set up a reverse proxy like a nginx or similar. The nginx is responsible to terminate the SSL and forward the request to varnish.

Magento 2 works well with varnish, even in a multi-site environment.

As you use Apache, you need to enable mod_proxy. In addition to that add a virtual host that listens to port 443 like so:

#/etc/apache2/sites-available/your-site.com-ssl
<VirtualHost *:443>
    ServerName www.your-site.com

    ProxyPreserveHost On
    ProxyPass / http://127.0.0.1:80/ 
    RequestHeader set X-Forwarded-Port "443"
    RequestHeader set X-Forwarded-Proto "https"

    SSLEngine On
    SSLCertificateFile /etc/apache2/ssl/example.com.crt
    SSLCertificateKeyFile /etc/apache2/ssl/example.com.key
    SSLCertificateChainFile /etc/apache2/ssl/example.com.chain
</VirtualHost>

The ProxyPass should point to your varnish instance.

Varnish in the open source version does not support SSL termination. Therefore you have to set up a reverse proxy like a nginx or similar. The nginx is responsible to terminate the SSL and forward the request to varnish.

Magento 2 works well with varnish, even in a multi-site environment.

Varnish in the open source version does not support SSL termination. Therefore you have to set up a reverse proxy like a nginx or similar. The nginx is responsible to terminate the SSL and forward the request to varnish.

Magento 2 works well with varnish, even in a multi-site environment.

As you use Apache, you need to enable mod_proxy. In addition to that add a virtual host that listens to port 443 like so:

#/etc/apache2/sites-available/your-site.com-ssl
<VirtualHost *:443>
    ServerName www.your-site.com

    ProxyPreserveHost On
    ProxyPass / http://127.0.0.1:80/ 
    RequestHeader set X-Forwarded-Port "443"
    RequestHeader set X-Forwarded-Proto "https"

    SSLEngine On
    SSLCertificateFile /etc/apache2/ssl/example.com.crt
    SSLCertificateKeyFile /etc/apache2/ssl/example.com.key
    SSLCertificateChainFile /etc/apache2/ssl/example.com.chain
</VirtualHost>

The ProxyPass should point to your varnish instance.

Source Link
David Lambauer
  • 1.1k
  • 2
  • 9
  • 25

Varnish in the open source version does not support SSL termination. Therefore you have to set up a reverse proxy like a nginx or similar. The nginx is responsible to terminate the SSL and forward the request to varnish.

Magento 2 works well with varnish, even in a multi-site environment.