CSchantz Wiki

Wordpress Proxy Config

Make sure the domain name is in the hosts file

/etc/hosts file to include the line 

127.0.1.1 blog.example.com.

Run the setup on Wordpress and set it up the way I like it, on 

http://example.com

Go into the Setting->General

WordPress Address (URL): http://blog.example.com

Site Address (URL): http://blog.example.com

Or

wp search-replace http://192.168.x.x https://blog.example.com

Add the following to the Nginx Proxy Advanced config

proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

Add the below to wp-config.php to the second line after “<?php”

if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
$_SERVER['HTTPS'] = 'on';
}

Add these two lines to the wp-config.php file if needed.

define( 'WP_HOME', 'https://blog.example.com' );
define( 'WP_SITEURL', 'http://blog.example.com' );