-
Hello world!
After significant trial and error I have now managed to self host a wordpress site on my OpenBSD httpd web-server. Getting an HTTP version was pretty straight forward, but as soon as I got into the weeds on HTTPS configuration it all went downhill.
Changing the wp-config.php file from http to https was the first obvious step, and naively I thought this would do it.
define('WP_HOME', 'https://oscarholm.co'); define('WP_SITEURL', 'https://oscarholm.co); define('FROCE_SSL_ADMIN', true);
As it turned out, this just made the entire admin section unavailable through infinite redirects. My OpenBSD httpd configuration and wordpress configuration were playing ping pong and nothing was coming through.
It seemed that WordPress was not completely recognizing that I was trying to serve the site through HTTPS, and my server was intentionally redirecting HTTP to HTTPS. I went through multiple server configurations and even updated all the values in the database with no result.
In the end, after rummaging through source files and documentation, and with trial and error, another option in wp-config.php did the trick:
$_SERVER['HTTPS'] = 'on';
Eureka!