WordPress: Too many redirects

ionicons-v5-k By Team Fullstack September 17, 2021

If WordPress is hosted behind a reverse proxy that provides SSL, but is hosted itself without SSL. These options will initially send any requests into an infinite redirect loop. To avoid this, you may configure WordPress to recognize the HTTP_X_FORWARDED_PROTO header (assuming you have properly configured the reverse proxy to set that header).

Place code at the beginning of the wp-config.php.

if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
   $_SERVER['HTTPS']='on';
else
   $_SERVER['HTTPS']='off';

link: https://wordpress.org/support/article/administration-over-ssl/

Team Fullstack Posted on September 17, 2021
Posted in Nginx, WordPress
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x