Working with Reverse Proxies and Multisite Installation

If you want wordpress to behave nice when asked to serve content from example.com you need to configure it to know that. This is done automatically at the install process for the domain on which wordpress is installed on but can also be controlled from wp-config.php by setting values to the WP_HOME and WP_SITEURL constants.

What you need to do is set the contants differently when a request comes from your proxy. You should have in your wp-config.php something like

if (request is comming from the proxy) {
  define('WP_HOME', 'http://www.revproxy.com'); 
  define('WP_SITEURL', 'http://www.revproxy.com');
}

This will solve problem with all the URLs which are generated by the wordpress APIs, but you will still need the code to convert links in the content to be “relative” or replace the domain based on the value of WP_HOME