varnishd config.

Cryer,Phil Phil.Cryer at edwardjones.com
Mon Oct 22 15:40:26 CEST 2007


> 
 
 If you are not the intended recipient of this message (including attachments), or if you have received this message in error, immediately notify us and delete it and any attachments.  If you no longer wish to receive e-mail from Edward Jones, please send this request to messages at edwardjones.com.  You must include the e-mail address that you wish not to receive e-mail communications.  For important additional information related to this e-mail, visit www.edwardjones.com/US_email_disclosure
 
-----Original Message-----
 

> From: varnish-misc-bounces at projects.linpro.no
[mailto:varnish-misc-bounces at projects.linpro.no] On Behalf 
> Of Dan Deshayes
> Sent: Monday, October 22, 2007 4:27 AM
> To: varnish-misc
> Subject: varnishd config.
> 
> When I go to the page it starts caching all the files and on reload
all the files are delivered from 
> varnishd.
> But when i go to a certain php on the page it forwards every request
to apache and when going back to 
> one of the former working tabs they also go
>
> From your headers I saw PHPSESSIONID, in that case you'll need some
logic to have it handle Auth or 
> cookies.  Here's my block on that:

For Auth/Cookies you need to tell Varnish to cache it, since the things
you're not caching are PHP pages, this is likely the issue.  Here's the
block from my config:

##############
# AUTH       #
##############
sub vcl_recv {
        if (req.request != "GET" && req.request != "HEAD") {
                if (req.request == "PURGE") {
                        if (!client.ip ~ purge) {
                                error 405 "Not allowed.";
                        }
                        lookup;
                }
                pipe;
        }
        if (req.http.Expect) {
                pipe;
        }
        if (req.http.Authenticate || req.http.Authorization) {
                pass;
        }
        # We only care about the "__ac.*" cookies, used for
authentication
        if (req.http.Cookie && req.http.Cookie ~
"__ac(|_(name|password|persistent))=") {
                pass;
        }
        lookup;
}

See if that helps, I'm not 100% clear on all of the syntax in the last
sub-block, or if it's necessary in my case - I too am still learning. ;)

P



More information about the varnish-misc mailing list