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.
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.
I had the same issue and solved this by adding the following to my Apache virtualhost for https:
<VirtualHost *:443> ## line below is the addition RequestHeader set X-Forwarded-Proto "https" [.... rest of vhost stuff goes here ....] </VirtualHost>
Then restart Apache. If you get an error that "RequestHeader" command is not recognized, then you need to add the headers module to Apache2:
sudo a2enmod headers
restart Apache and clear your M2 cache and it should be working perfectly.
I hope this can help someone. I've wasted hours on this same issue today...
please set: web/secure/use_in_frontend and web/secure/use_in_adminhtml to 0
Please read here for more detail:
https://mrvts.wordpress.com/2018/12/17/magento-2-nginx-varnish-full-page-cache-backend-admin-redirec...
Hi, did you manage to fix that ? I'm trying to fix that for few months now with no luck.