Closed mitar closed 8 years ago
For Wordpress I had to add the following to wp-config.php
:
define('FORCE_SSL_ADMIN', true);
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false) {
$_SERVER['HTTPS']='on';
}
if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) {
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
Then I used wp-cli:
su - -s /bin/bash -c 'php /tmp/wp-cli.phar --path=/wordpress search-replace "http://cloyne.org" "https://cloyne.org"' fcgi-php
This got rid of all mixed-content errors because Wordpress stores all image paths into blog post content directly at the time of creation.
Done. Both https://council.cloyne.org/ and https://cloyne.org/ now exist.
nginx-proxy has now Let's encrypt support. So it should be pretty easy to add HTTPS everywhere.