Page 1 of 1

s2Member + Squid reverse proxy

PostPosted: June 19th, 2010, 10:53 am
by johnmont
I'm curious if anyone has used s2 with Squid as a reverse proxy for caching (it passes requests on to apache). We use this and it works tremendously to speed up the site. However, it appears to break s2 as a user is able to view restricted posts when not logged in. Turning off squid fixes this problem.

Some notes

1. With Squid on, the correct text is displayed in the post when embedding php code in the post. So if we add that test php code including this :
Code: Select all
<?php } else { ?>
    Some public content.
<?php } ?>

The post does actually show "Some public content." (or the other appropriate text based upon member level). So that part seems to be working.

2. I thought it might be an IP address issue, since that doesn't get passed to apache and instead the $_SERVER['HTTP_X_FORWARDED_FOR'] variable is the one that contains the actual user IP. So I found where IP address logging is located in the s2Member includes/functions, modified the file, and s2 correctly got the IP address. But this didn't fix the problem.

3. Turning off squid fixes the problem.

I'm curious if anyone has any suggestions as to what is or isn't making it through to WordPress

Thanks

Re: s2Member + Squid reverse proxy

PostPosted: June 19th, 2010, 12:06 pm
by Jason Caldwell
Hi John. I've not used Squid Proxy before, but I know that s2Member ( w/ Quick Cache ) works very well together. I wrote both of these plugins; and they've been matched up to work together seamlessly.