Redirect loop with Nginx SSL termination via Varnish/Apache On Wordpress -
i have setup apache listens on port 8080 behind varnish 4 on port 80, client needs ssl working on site setup nginx ssl termination on port 443 using this guide.
everything works fine @ first on http, on attempting load site on https, scripts required site won't load, decided change site url in settings > general
https url, on saving changes, redirect loop error in chrome.
i couldn't access site's wordpress dashboard change url had via phpmyadmin. when site accessed via https, site breaks cause scripts requires render content aren't authenticated.
someone else has same issue here doesn't solved.
how can have site on https
without redirect loop in chrome?
after hours of trying work, found fix, had add http_x_forwarded_proto
in wp-config.php
before changing site url, way:
if ($_server['http_x_forwarded_proto'] == 'https') $_server['https']='on';
one more thing had add proxy_set_header x-forwarded-protocol $scheme;
default
file in /etc/nginx/sites-enabled/default
looks this:
server { ... location / { ... proxy_set_header x-forwarded-protocol $scheme; } }
hope helps out there.
Comments
Post a Comment