skip to Main Content

Thank you for looking on this.

I have a Magento 2.1.8 website and it will run on the Amazon EC2 with this https://aws.amazon.com/marketplace/pp/B007OUYR4Y Amazon AMI.

I have optimized everything on Magento 2 website but did not get the proper result on this.

I have tried to use the Varnish cache but it is not working with the HTTPS.

anyone have an idea, how can use the varnish with the HTTPS to optimize the website speed.

2

Answers


  1. Varnish Cache does dot speak HTTPS natively. You’ll need an SSL terminator such as Hitch, HAProxy, etc. deployed in front of Varnish, ideally using the PROXY protocol.

    Login or Signup to reply.
  2. With my setups I use NGINX as a proxy to handle both http and https requests and then use Varnish as the backend so NGINX handles all the SSL certificates.

    Here’s an example of my NGINX ssl template:

    server {
        listen  server-ip:443 ssl;
        server_name example.com www.example.com;
        ssl_certificate  /home/user/conf/web/ssl.example.com.pem;
        ssl_certificate_key  /home/user/conf/web/ssl.example.com.key;
    
        location / {
          proxy_pass  http://varnish-ip:6081;
          proxy_set_header Host $host;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $remote_addr;
          proxy_set_header X-Forwarded-Proto https;
          proxy_set_header X-Nginx on;
          proxy_redirect     off;
        }
    
        location @fallback {
            proxy_pass  http://varnish-ip:6081;
        }
    
    
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search