To resolve this, vBulletin 4.2+ and 5.1.9+ have a Reverse Proxy IP feature that can be easily configured in config.php file.
Using an FTP client (e.g. FileZilla) or cPanel File Manager, navigate to the config.php file and edit it. For vB5, the file is located at <forum root directory>/core/includes/config.php. For vB4, it is located at <forum root directory>/includes/config.php.
Scroll down to the Reverse Proxy IP section. Below is a snippet of this section:
PHP Code:
/* #### Reverse Proxy IP ####
If your use a system where the main IP address passed to vBulletin is the address of a proxy server
and the actual 'real' ip address is passed in another http header then you enter the details here */
/* Enter your known proxy servers here. You can list multiple trusted IPs separated by a comma.
You can also use the * wildcard (at the end of a definition only) or use the keyword 'all' to represent any ip address.*/
//$config['Misc']['proxyiplist'] = '127.0.0.1, 192.168.*, all';
/* If the real IP is passed in a http header variable other than HTTP_X_FORWARDED_FOR, then you can set the name here; */
//$config['Misc']['proxyipheader'] = 'HTTP_X_FORWARDED_FOR';
For vB5, you can use the keyword 'all' in the 'proxyiplist' setting and you don't have to enumerate all the CloudFlare/Sucuri IP addresses. You can also use IP ranges. But I prefer using the 'all' keyword so I don't have to maintain the IP list which can get updated. This is what I did here on this site.
For vB4, I believe you have to specify the list of all CloudFlare/Sucuri IP addresses. No IP ranges or 'all' keyword.
Link to the CloudFlare IP addresses:
Link to the Sucuri IP addresses (scroll down to vBulletin 4.2+)
For rhe 'proxyipheader' settings, you can keep the default proxyipheader value 'HTTP_X_FORWARDED_FOR' for CloudFlare. If that doesn't work, then use 'CF-Connecting-IP'.
For Sucuri, use 'HTTP_X_SUCURI_CLIENTIP'.
To summarize:
CloudFlare (vB5): (this is what I used on this site)
PHP Code:
$config['Misc']['proxyiplist'] = 'all'; // or use the IP addresses in https://www.cloudflare.com/ips/
$config['Misc']['proxyipheader'] = 'HTTP_X_FORWARDED_FOR'; // or use 'CF-Connecting-IP'
CloudFlare (vB4):
PHP Code:
$config['Misc']['proxyiplist'] = '<use the CloudFlare IP addresses>'; // IP addresses in https://www.cloudflare.com/ips/
$config['Misc']['proxyipheader'] = 'HTTP_X_FORWARDED_FOR'; // or use 'CF-Connecting-IP'
Sucuri (vB5):
PHP Code:
$config['Misc']['proxyiplist'] = 'all'; // or use the IP addresses in https://kb.sucuri.net/firewall/Troubleshooting/same-user-ip (scroll down to vBulletin 4.2+)
$config['Misc']['proxyipheader'] = 'HTTP_X_SUCURI_CLIENTIP';
Sucuri (vB4):
PHP Code:
$config['Misc']['proxyiplist'] = '<use the Sucuri IP addresses>'; // IP addresses in https://kb.sucuri.net/firewall/Troubleshooting/same-user-ip (scroll down to vBulletin 4.2+)
$config['Misc']['proxyipheader'] = 'HTTP_X_SUCURI_CLIENTIP';
درمان هموروئید
Was looking for a solution