XF 1.5 StackPath: User IPs Always getting Logged out

JordanH

Well-known member
Alright so, StackPatch is Max CDN's new content delivery network. They also have an option now similar to how cloudflare works.
However, with this option, User IP's are now all StackPath IP's.
With Cloudflare, you were able to put something like this in your config file:
Code:
if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) { $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP']; }
However, being that "HTTP_CF_CONNECTING_IP" is cloudflares XFF header, it wont exactly work with StackPath for obvious reasons.

This is causing a lot of issues with my forums. Most notably that the IP's of users are not correct, and users are just constantly being logged out.
StackPath does have an XFF Header option: https://snap.me/HNxxAZ However, it does not seem to be working.

I was wondering if there was anything else I could put in my config file or anything at all to restore users correct IP's
 
For anyone using stackpath and searching for a solution. Add this to config.php:
Code:
if (isset($_SERVER['HTTP_X_FORWARDED_IP']))
{
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_IP'];
}
 
Back
Top Bottom