I am setting up a WordPress MU installation running on two web servers behind a load balancer. Whenever an email is generated to notify us of a new registration, it says that the remote IP address is the address of the load balancer rather than the original source IP address.
In investigating this issue, I have found that WordPress MU is using the $_SERVER['REMOTE_ADDR'] environment variable to obtain this IP address. I also know that our load balancer sets its own environment variable (let's call it $_SERVER['LOAD_BAL_IP'] for obfuscation purposes) that contains the actual source IP. What I do not know is if there is an easy way to tell WordPress to use this environment variable instead of the REMOTE_ADDR to generate the IP address for these notification emails.
I have found various places in WPMU code where REMOTE_ADDR is used, and one obvious solution would be to simply change each of them to LOAD_BAL_IP. However, this would require a hack to WPMU core code, and would have to be reinstated each time I did an upgrade.
I have also tried modifying the index.php script in both the root level /wordpress/ directory and the one in /wp-admin/ to include a statement like this:
$_SERVER['REMOTE_ADDR'] = $_SERVER['LOAD_BAL_IP'];
... but it doesn't seem to stick for some reason.
Can anybody think of a solution that would work?