I have a statically served site (using nginx). I want to host a wordpress blog (hosted on a different instance) under /blog folder. When using a nginx proxy:
location /blog/ {
proxy_set_header X-Is-Reverse-Proxy "true";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://55.555.55.555;
}
and the following wp-config.php:
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/');
define('WP_HOME', 'http://SOMESITE.com/blog/');
All the files from wp-content (and wp-includes) are not being served correctly, since they are being searched under http://SOMESITE.com/wp-content/*
instead of http://SOMESITE.com/blog/wp-content/*.
Adding some extra proxy rules didn't work, ex:
location ~* (\/wp-content) {
proxy_set_header X-Is-Reverse-Proxy "true";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://55.555.55.555;
}
nor redefining the wp-config.php:
define('WP_SITEURL', 'http://SOMESITE.com/blog/');
Would love any ideas. I am also pretty sure it is a common use case, but couldn't find any working tricks here.
THX.