Log in

View Full Version : reverse proxy & user ips


wowglider
12-05-2010, 07:00 PM
Hello,
ive installed a setup with:
1 load balancer with cache (nginx)
1 http server (apache for php)
1 mysql server

everything works great, good performance.

But only one problem.

I think the ip is not always correct sometimes at some users vbulletin shows the load balancer ip instead of the users ip:

look at this "online.php":
https://vborg.vbsupport.ru/attachment.php?attachmentid=124210&stc=1&d=1291582730

server2 is my load balancer... why is this happen? i also changed something in class core php:
* Fetches the IP address of the current visitor
*
* @return string
*/
function fetch_ip()
{
return (getenv(HTTP_X_FORWARDED_FOR))
? getenv(HTTP_X_FORWARDED_FOR)
: getenv(REMOTE_ADDR);
}

but it didnt help, any ideas?

wowglider
12-09-2010, 09:32 PM
any help? if im missing something just say...