New server - $_SERVER['REMOTE_ADDR'] using private IP instead of user IP
I was testing bbPress on the new server and the IP address that is logged for each forum post uses a private IP address by the server, instead of the user's IP.
The issue is bbPress uses
$_SERVER['REMOTE_ADDR'] to attempt to grab the user's IP. However, the load balancer uses
I'm thinking we could override
HTTP_X_FORWARDED_FOR manually in wp-config.php as recommend in this WP Trac ticket:
Updated by Raymond Hoh about 6 years ago
Boone, I've committed the change on the server (commit 90e7f9a), but haven't pushed it to Github because I haven't pulled the latest changes to master branch on the server yet.
Wasn't sure what the release strategy was for 1.9.22, so thought I'd touch base with you before I did a
git pull on the server.
Updated by Boone Gorges about 6 years ago
Thanks, Ray. The commit looks good.
Since it's looking like the regularly scheduled 1.9.22 release will go out before the server migration, please do keep the 1.9.x and master branches so that they continue to work properly on the existing server. That said, your HTTP_X_FORWARDED_FOR check should mean that the commit does nothing at all on the existing server (unless someone's doing something nefarious), so I don't see any harm in putting it into the mainline branch.