After setting up an Amazon Elastic Load Balancer, where SSL terminates, I was getting Mixed Content errors on the site, until I added the following line to wp-config.php
.
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
$_SERVER['HTTPS']='on';
While this fixed the Mixed Content errors, now I get this PHP Notice after using wp-cli:
PHP Notice: Undefined index: HTTP_X_FORWARDED_PROTO in phar:///opt/bitnami/apps/wordpress/bin/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1169) : eval()'d code on line 81
What should I do?