|
Joined: Dec 2006
Posts: 7
stranger
|
stranger
Joined: Dec 2006
Posts: 7 |
We just moved out forum box behind an F5 loadbal/proxy, as part of getting all our machines behind it, even if they aren't load balanced. However, now, all members are logged by the IP of the F5 rather than their origin IP. The F5 is sending the X-Forwarded-For header correctly, but ubb doesn't seem to use this.
How can I config ubb to log members based on the X-Forwarded-For header rather than our proxy address?
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
You'd probably need to change a few scripts depending on version. If you look for any files in the scripts and libs directories where it gets REMOTE_ADDR then you could change that to the environment variable that you actually need.
|
|
|
|
Joined: Dec 2006
Posts: 7
stranger
|
stranger
Joined: Dec 2006
Posts: 7 |
yeah, I did a quick search on REMOTE_ADDR before I saw your reply, and found it in the following scripts.
libs/captcha.inc.php: libs/includepoll.inc.php: libs/ubbthreads.inc.php: libs/mysql.inc.php: libs/phpmailer/class.phpmailer.php: scripts/captcha.inc.php: scripts/addpost.inc.php: scripts/adduser.inc.php: scripts/dopoll.inc.php: scripts/shoutit.inc.php: scripts/start_page.inc.php:
Which is a fair amount to go poking around in. Most of them are of the form
$ip = find_environmental('REMOTE_ADDR');
so changing them to
$ip = find_environmental('X_FORWARDED_FOR');
should work without too much anguish.
The captcha seems to use it as part of generating unique image names. Of course, making this change will mean that the forums wouldn't work if they *weren't* behind a proxy that sent the X_FORWARDED_FOR header, but that's a different issue.
Oh, and we are currently running UBBThreads 7.1, and plan on upgrading in the not to distant future to the latest version.
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
We'll need to put in a central function for this in an update so it's not scattered all over the place. Maybe even a control panel option where it can be decided which IP should be grabbed.
|
|
|
|
Joined: Dec 2006
Posts: 7
stranger
|
stranger
Joined: Dec 2006
Posts: 7 |
That would be my preference, a clicky button, an option. For now, we'll probably make a change to our existing setup, and hope that the clicky button is there when we upgrade later. Thanks.
|
|
|
|
Joined: Jun 2006
Posts: 16,299 Likes: 116
|
Joined: Jun 2006
Posts: 16,299 Likes: 116 |
I figured we'd have a config variable $ip that could be "easily" updated...
|
|
|
|
Joined: Dec 2006
Posts: 7
stranger
|
stranger
Joined: Dec 2006
Posts: 7 |
|
|
|
|
Joined: Jun 2006
Posts: 956
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 956 |
What is the status of this? My hoster change his server and now we have a localhost ip address problem. Will bring V8 support for this?
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
Yes, we're going to put in a few options to account for this in v8.
|
|
|
|
Joined: Jun 2006
Posts: 956
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 956 |
|
|
|
|
Joined: Feb 2014
Posts: 6
stranger
|
stranger
Joined: Feb 2014
Posts: 6 |
Is the X-Forwarded-For header options included in 7.5.8?
|
|
|
|
Joined: Jun 2006
Posts: 16,299 Likes: 116
|
Joined: Jun 2006
Posts: 16,299 Likes: 116 |
Is the X-Forwarded-For header options included in 7.5.8? No; it would require modifying the coding if this functionality would be required.
|
|
|
Bots
by Outdoorking - 04/13/2024 5:08 PM
|
|
|
|
|
|
0 members (),
541
guests, and
181
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|