rate behind reverse proxy #839

Open
opened 2026-10-05 00:20:03 +02:00 by adam · 0 comments
Owner

Hi,

I had a problem to allow guest to rate pictures. My Piwigo is behind a reverse proxy. All of guests are recognized as same user (even if there ip changes).
I looked at the code. I replaced $_SERVER["REMOTE_ADDR"]); with $_SERVER["HTTP_X_FORWARDED_FOR"]); and deleted the block

if (count($ip_components) > 3)
  {
    array_pop($ip_components);
  }

in file functions_rate.inc.php, picture_rate.inc.php, functions.inc.php and functions_session.inc.php

It's just a little patch to correct the bug, but does it plane to manage reverse proxy or not in this situation ?

Regards

Hi, I had a problem to allow guest to rate pictures. My Piwigo is behind a reverse proxy. All of guests are recognized as same user (even if there ip changes). I looked at the code. I replaced `$_SERVER["REMOTE_ADDR"]);` with `$_SERVER["HTTP_X_FORWARDED_FOR"]);` and deleted the block ``` if (count($ip_components) > 3) { array_pop($ip_components); } ``` in file functions_rate.inc.php, picture_rate.inc.php, functions.inc.php and functions_session.inc.php It's just a little patch to correct the bug, but does it plane to manage reverse proxy or not in this situation ? Regards <!-- github-sync-id:375125257 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#839