Search Suggest

Bài đăng

[SOLVED] Wordpress Behind Reverse Proxy: Too Many Redirect Error

I have installed a wordpress behind a reverse proxy to conserve IP address and also to simplify SSL certification renewal.

However I have encountered issue with wordpress thinking that it is running on NON-HTTPS while in-fact it is.

To trick wordpress to think it is running in SSL mode, I inserted the following PHP codes on the very top of wp-config.php:


if ( (!empty( $_SERVER['HTTP_X_FORWARDED_HOST'])) ||
(!empty( $_SERVER['HTTP_X_FORWARDED_FOR'])) ) {
$_SERVER['HTTPS'] = 'on';
}

I hope this helps somebody. Thanks for reading -LinuxCloudCoder

Đăng nhận xét