Log in

View Full Version : vbulletin and squid + proxy headers


richgrech
10-23-2008, 07:33 PM
Hi there -

We are using squid as a reverse proxy and this causes obvious issues when a user locks themselves out because all requests come from the same server.

Squid is sending x-forwarded for but someone familiar with squid said i need to configure vbulletin to trust these headers from the proxy...that by default it does not. However, I can't find anything in the manual that references this (at least by using search).

I am running the latest version of vbulletin.

Thanks,
Rich

Marco van Herwaarden
10-24-2008, 08:50 AM
You must make sure that the proxy server forwards the original IP address and not all connection are made with the IP of the proxy server.

richgrech
10-24-2008, 02:08 PM
My proxy server is forwarding the original IP address - it doesn't look like vbulletin is recognizing this.

--------------- Added 1224877619 at 1224877619 ---------------

I wound up modifying this line in class_core.php.

$alt_ip = $_SERVER['REMOTE_ADDR'];
to
$alt_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];

in order to force the alt_ip as the http_x_forwarded_for address.

For some reason the default conditional logic did not seem to be getting the job done.