Wedge

Public area => The Pub => Bug reports => Topic started by: Pandos on May 23rd, 2014, 11:39 AM

Title: [Proxy Settings] X-Forwarded-For not recognized
Post by: Pandos on May 23rd, 2014, 11:39 AM
Server is behind a remote proxy. Logs already got the right X-FORWARDED-FOR IP.
In Wedge all users got the IP from the remote proxy (192.168.x.x). Also putting the proxy IP in settings did not change this value.
Title: Re: [Proxy Settings] X-Forwarded-For not recognized
Post by: Pandos on May 23rd, 2014, 01:17 PM
Dig a bit deeper into it. The real IP is saved in DB as IP2. IP1 is the proxy IP :)
Title: Re: [Proxy Settings] X-Forwarded-For not recognized
Post by: Nao on May 30th, 2014, 01:59 PM
So, it's not for the Bug Reports board but for some FAQ, right...? ;)
Title: Re: [Proxy Settings] X-Forwarded-For not recognized
Post by: Pandos on May 30th, 2014, 04:23 PM
No?
If users are behind a reverse proxy the IP should display the right way? Not due to changes to the core?
Title: Re: [Proxy Settings] X-Forwarded-For not recognized
Post by: Pandos on May 30th, 2014, 04:28 PM
Just created a little script to determine the real IP:

Code: [Select]
<?php
echo 'Server IP: ' $_SERVER['SERVER_ADDR'] . '<br />';
echo 
'Your IP: ' $_SERVER['REMOTE_ADDR'];

if(isset(
$_SERVER['HTTP_X_FORWARDED_FOR']))
{
   echo 
'<br />Forwarded For: ' $_SERVER['HTTP_X_FORWARDED_FOR'];
}

echo 
getenv('HTTP_VIA'),"\n";
?>

And here's the output from one user:

Server IP: 192.168.148.9
Your IP: 192.168.148.6
Forwarded For: 87.152.XXX.XXX
VIA:

So enabling forwarded for should do read the forwarded IP, right?

You can test it. You've got access to this server :)
Title: Re: [Proxy Settings] X-Forwarded-For not recognized
Post by: Nao on June 3rd, 2014, 01:05 AM
I understand, but I was just asking, what's best for users? What do you want me to do exactly..?
Title: Re: [Proxy Settings] X-Forwarded-For not recognized
Post by: Pandos on June 3rd, 2014, 01:22 AM
Change it, that the Forwarded IP is displayed and not 192.168.148.6 behind reverse proxys. :)