Customizing SMF > SMF Coding Discussion
IP detection behind a reverse proxy
user1234:
--- Quote from: talkleft on July 06, 2012, 04:50:19 PM ---Joshua, thanks for the reply. Is there a place I can go to access what you added? Or do you have a recommendation to fix it manually?
--- End quote ---
It don't know quite how, but I just stumbled across your post. If you haven't fixed the problem yet, I copy and pasted the following directions from my thread in the charter members section.
The following changes are to be made in your "Load.php" directory which is in your "sources" directory:
--- Quote from: emanuele on June 02, 2012, 07:50:58 AM ---That trick should affect only the link you see close to "report to moderator" (I think).
That would be a bit more...extreme, but you can try to change in Load.php:
--- Code: --- 'ip' => $_SERVER['REMOTE_ADDR'],
'ip2' => $_SERVER['BAN_CHECK_IP'],
--- End code ---
into
--- Code: --- 'ip' => $_SERVER['BAN_CHECK_IP'],
'ip2' => $_SERVER['BAN_CHECK_IP'],
--- End code ---
But honestly I don't know if this could affect something else...
--- End quote ---
It worked for me. Haven't noticed any ill effects.
Arantor:
It will only work for you because your reverse proxy uses X-Forwarded-For, other reverse proxies may or may not work.
Navigation
[0] Message Index
[*] Previous page
Go to full version