Closed alterego23 closed 7 years ago
What are you using to terminate HTTPS? Varnish can't do that alone. You need Nginx or HAProxy in front of it. No problems with HTTPS here, apart from my pull request in #59.
I'm using Apache proxy to offload HTTPS
So my setup is like this:
Apache proxy (443) -> Varnish (80) -> Apache (8080).
I posted my apache conf and vcl on stackexchange: http://magento.stackexchange.com/questions/162007/apache-proxy-varnish-magento-https-not-caching
Do you see any misconfiguration?
The only things I added in .vcl are
if (req.http.host ~ "(preprod)") { set req.http.Https = "on";
301 redirect HTTP to HTTPS
Thank you.
Your issue is likely that Phoenix_VarnishCache_Helper_Cache ::setCacheControlHeaders
has this check:
// disable caching of secure pages
if (Mage::app()->getStore()->isCurrentlySecure()) {
return $this->setNoCacheHeader();
}
Which means by default the extension won't cache https pages. You can rewrite the helper and comment that check out if you have the server configured correctly (which at a glance you do). Obviously perform tests in a test environment, yadayada.
Hi pocallaghan,
I'll test this today, I'm pretty sure that this will fix my problem. I'll let you know!
Have a nice day!
Hi pocallaghan,
I commented the lines in the helper. Varnish is now caching HTTPS pages 👍
Problem solved.
Thank you !
Now just be careful you aren't caching anything important (like the form_key on the product page).
OKay but I'm using Magento CE 1.5.1. I think that this version doesn't use "form_key" on product page. Is it correct ?
Hi,
I successfully switched to HTTPS by :
Now, Varnish is not caching anymore. Is it caused by phonix-media module which can't handle https?
I delete this "req.http.Https" in default vcl but still does not work:
not cacheable by default
Someone has a store running on HTTPS with varnish caching static files and html pages ?
Thank you.