Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

piwigo "historique" records haproxy ip address instead of visitors source ip address #2109

Open
Gegele1 opened this issue Feb 3, 2024 · 0 comments

Comments

@Gegele1
Copy link

Gegele1 commented Feb 3, 2024

When used behind Haproxy, piwigo logs haproxy ip address as visitors source ip address instead of visitors real ip address. This was described in piwigo forum by docofchaos in september 2016. Docofchaos also proposed a fix :

edit functions.inc.php in /usr/local/www/apache24/includes:

comment $ip = $_SERVER['REMOTE_ADDR'];

and insert

if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])){
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}

This fixed the problem for me in piwigo 14.2.0 (freebsd implementation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant