I’ve been messing with this for two days and can’t find the magical combination.
I’m using Magento 2 on CentOS 7 with nginx handling SSL passing off to varnish on port 80 which passes on to apache on 8080 which uses php-fpm. I can get Magento to work with just varnish -> apache -> php-fpm but when I try to introduce nginx in the mix to handle the SSL I get a redirect loop on the entire site. I’ve found all kinds of suggestions here and other places but nothing seems to fix it.
Does anyone have a good guide or any direction on what to do here? Can post configs if necessary.
2
Answers
Please try by clearing your cookies, most of the time it does fix for me.
Well, it’s hard to say anything without seeing the code and what redirect you’re getting exactly. But if I would have to bet you’re missing an
x-forwarded-proto
header so PHP assumes you connected with HTTP and sends you to HTTPS. Try this in your Varnish configuration: