diff --git a/NOTES_ON_WORDPRESS.md b/NOTES_ON_WORDPRESS.md new file mode 100644 index 0000000..33970f5 --- /dev/null +++ b/NOTES_ON_WORDPRESS.md @@ -0,0 +1,33 @@ +# Notes on exporting/importing wordpress + +Wordpress is an extremely tricky CMS to move. The local configuration assumes +the root url being at `http://localhost:8080`, but we want to publish the site +on a public, TLS protected address. + +In order to do so, many steps have to be taken. + +### Export the db + +The database has to be exported, and all occurrences of `http://localhost:8080` +have to be replaced with the public url, including the protocol. + +### Ensure that the wordpress installation knows its public url + +Using wordpress provided by docker, we need to set in the production container +environment the variable + +``` +WORDPRESS_CONFIG_EXTRA="define( 'WP_SITEURL', '' );" +``` + +### Configure the reverse proxy + +The reverse proxy where the TLS termination happens must pass the following +header to the wordpress container + +``` +X-Forwarded-Proto: https +``` + +otherwise all the assets are served through an unencrypted connection and the +browser (rightly so), refuses to load them.