Redirect loop with site after turning on HTTPS

Due to a change with Wordpress and how it detects HTTPS it now may break if using both Cloudflare and due to us using a NGINX proxy.

As long as you have HTTPS working and you are just getting a redirect loop the fix is to tell Wordpress when HTTPS is already working via a simple rule on the top of the wp-config.php file. This rule will detect the proxy using HTTPS when making the request and tell Wordpress it's OK and to NOT make a redirect.

define('FORCE_SSL_ADMIN', true);  
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false){
    $_SERVER['HTTPS']='on';
}