Somewhat related:
Since I'm receiving the request on port 80 I need to tell WordPress that the request is really an HTTPS request. I do the following in wp-config.php
which works but this should probably be done at the Nginx level
/*
Set $_SERVER variables if the request is being passed from an HTTPS request from the load balancer. Otherwise is_ssl() doesn't work and we get endless redirects
*/
if ( 'https' === $_SERVER['HTTP_X_FORWARDED_PROTO'] ) {
$_SERVER['HTTPS'] = 'on';
$_SERVER['SERVER_PORT'] = '443';
}
If I don't do this then is_ssl()
returns false and wp-login.php
goes into an infinite redirect loop.