WordPress: Too Many Redirects Issue when NGINX reverse proxy to Apache

I installed NGINX and put it in front of Apache for SSL offloading and caching static content. Traffic is proxied from Nginx to Apache.  When I tried to open site via https, it returned this painful error “Too Many Redirects”.

Try to add this in your wp-config.php – if you have everything else configured correctly, it should work:

$_SERVER['HTTPS'] = 'On';


Got Something To Say:

Your email address will not be published. Required fields are marked *


I accept the Privacy Policy * for Click to select the duration you give consent until.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

You are a life saver! Thank you so much for posting this!

Kudos for this. Would be great to have a little more detail to this solution. Thanks@

I’ve searched a lot, but this artcle helped me so much.
Thank you very muuuuuuch 🙂

OMG, I wish I had read this 3 hours ago! Thank you, I finally can sleep now!
Just one line, and yet it makes all the different. A must for everyone using docker, for example, with an nginx reverse proxy.

Just add this to your proxy_pass configuration

proxy_set_header X-Forwarded-Proto https;

as you see wp is already searching for that

$_SERVER[‘HTTPS’] = ‘on’;

This is the only answer to my 100 question to my senior dev.HAHAHA

Very useful. It worked for me.

I tried many other solutions but this one did the trick.

Thanks a lot!

© 2020 geegkytuts.net
Hosted by Hosterdam

About author