XF 1.5 StackPath: User IPs Always getting Logged out

JordanH

Well-known member
#1
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
 

Mike

XenForo developer
Staff member
#2
The $_SERVER value would be in HTTP_X_FORWARDED_FOR based on the screenshot. Is that what you tried?
 

JordanH

Well-known member
#3
The $_SERVER value would be in HTTP_X_FORWARDED_FOR based on the screenshot. Is that what you tried?
No I Didn't try that. I tried it and it appears to be providing the correct IP.
However, Users are still being logged out now still.
 

Alfa1

Well-known member
#4
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'];
}
 
Top