Solution:
I had the same issue. My WordPress(WP) service was behind a proxy where SSL termination take place. At first I had to make sure .htaccess
file is valid for my scenario. I followed this WordPress support documentation to verify that. Then, I had to enable SSL for WordPress administration (in wp-config.php
),
define('FORCE_SSL_ADMIN', true);
And I had to configure WP to recognise HTTP_X_FORWARDED_PROTO headers
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') $_SERVER['HTTPS']='on';
PS: I would add these changes on the top of the wp-config.php
file.