Project

General

Profile

Actions

Bug #5850

closed

New server - $_SERVER['REMOTE_ADDR'] using private IP instead of user IP

Added by Raymond Hoh over 8 years ago. Updated over 8 years ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
Server
Target version:
Start date:
2016-07-28
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

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 $_SERVER['HTTP_X_FORWARDED_FOR'].

I'm thinking we could override REMOTE_ADDR with HTTP_X_FORWARDED_FOR manually in wp-config.php as recommend in this WP Trac ticket:
https://core.trac.wordpress.org/ticket/9235#comment:12
https://core.trac.wordpress.org/ticket/9235#comment:40

Actions

Also available in: Atom PDF