A WordPress site secured with SSL and running on an nginx as a reverse proxy to an Apache

A WordPress site secured with SSL and running on an nginx as a reverse proxy to an Apache

Today I needed to transfer a WordPress site from one server to another. This proved more difficult then I tough.

The new server is running an Nginx that serves as a reverse proxy to an Apache. The latter does, for example all the php stuff. It also serves only SSL pages and redirects all traffic on port 80 to 443.

After a lot of “google’ing” and trial and error, this was what I needed to configure in the wp-config.php file.

$_SERVER['HTTPS']='on';
$_SERVER['SERVER_SOFTWARE'] = 'Apache';

Notw the trick is to put this before the last include statement.

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

Lastly because of the move, the domain name changed too, so check the wp_options (wp_: replace this with whatever prefix you have defined) table in the database.

Make sure the siteurl and home values are set to the new address.

It should work now.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.