簡體   English   中英

如何使用 HTTPS 配置帶有清漆緩存的 Magento 2

[英]How can configure the Magento 2 With Varnish Cache with HTTPS

謝謝你看這個。

我有一個 Magento 2.1.8 網站,它將使用這個https://aws.amazon.com/marketplace/pp/B007OUYR4Y Amazon AMI 在 Amazon EC2 上運行。

我已經優化了 Magento 2 網站上的所有內容,但沒有得到正確的結果。

我曾嘗試使用 Varnish 緩存,但它不適用於 HTTPS。

任何人都有一個想法,如何使用帶有 HTTPS 的清漆來優化網站速度。

Varnish Cache 本身就使用 HTTPS。 您需要在 Varnish 前面部署一個 SSL 終結器,例如HitchHAProxy等,最好使用 PROXY 協議。

在我的設置中,我使用 NGINX 作為代理來處理 http 和 https 請求,然后使用 Varnish 作為后端,因此 NGINX 處理所有 SSL 證書。

這是我的 NGINX ssl 模板的示例:

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;
    }


}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM