cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.2.2 with Varnish 4.1.9 and apache 2.4 has ssl redirect loop error

Magento 2.2.2 with Varnish 4.1.9 and apache 2.4 has ssl redirect loop error

We hope someone can point us to a new direction as we're at our wits end on this.
We installed Magento 2.2.2 CE when it first came out and hired a system engineer to set up Varnish for the server to work with Magento. Once Varnish starts, all https pages has an redirect loop error.

 

Since then, we have been trying to fix this issue without any solutions.(including hiring Magento certified people to take a look). The person who originally set up the Varnish has look into the matter and said that the settings for Vanish are correct and that the issue must be on Magento settings.


We've tried everything we've seen suggested online.
adding SetEnvIf X-Forwarded-Proto "https" HTTPS=on to .htaccess

trying all possible combination of settings for web/secure/use_in_frontend, web/secure/use_in_adminhtml, web/secure/enable_hsts, web/cookie/cookie_domain(between null and actual web url), web/secure/enable_upgrade_insecure and adding https to web/unsecure/base_url

We've also tried all possible combination of settings along with adding the SetEnvIf code.
We've cleared cache and cookie and tried different browser on every test attempt.

 

The only time we saw any change in our testing result was turning "Auto-redirect to Base URL" to No. With that setting and Varnish being on, https will work for the frontend but going to the custom admin url results in a 404 not found error.

 

We've been at this for so long that 2.2.3 is now out and we've not gain much on this issue. Any suggestions or insight is greatly welcomed.

2 REPLIES

Re: Magento 2.2.2 with Varnish 4.1.9 and apache 2.4 has ssl redirect loop error

Hello @iKitkat
Few things to you can consider checking.
1. Base url configuration in database, sometimes those are 2 times (cause of table prefix) when you search "web" in database. So please check that base url. Is correctly configured with https.
2. Please see if you have enabled use secure url yes for both frontend and backend.
3. Upload default .htaccess file of Magento and check
Found something useful, please give "Kudos" or "Accept as Solution" for Token of Appreciation.
Free Magento Extensions : https://magecomp.com/free-magento-extensions.html

Re: Magento 2.2.2 with Varnish 4.1.9 and apache 2.4 has ssl redirect loop error

Thanks for taking the time to reply and help.

Unfortunately your suggestion did not solve our issue.

We double checked again for all "web" in database and it is correct with https and both use secure url for frontend and backend is yes.
We uploaded the default .htaccess file from Magento and retested but issue is still the same.