Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Varnish: Misc

Pipe all remaining requests if URI / condition is met

 

 

Varnish misc RSS feed   Index | Next | Previous | View Threaded


k at kevinkevin

Sep 21, 2011, 10:24 AM

Post #1 of 3 (546 views)
Permalink
Pipe all remaining requests if URI / condition is met

Hello,



I'm curious if its possible to set varnish to pipe all subsequent requests
(ignoring any rules that say otherwise) if certain specific conditions are
met (i.e. user visits a login page and is returned to the main page).



I am having problems with cookies, sessions among many other things and
would just like to pipe all logged in traffic after the login page is
visited. I realize this isn't efficient, but for troubleshooting purposes
and limitations by the CMS I'm using (joomla) , doing this will at least
return some function to the site itself.



Thanks


lampe at hauke-lampe

Sep 21, 2011, 12:57 PM

Post #2 of 3 (522 views)
Permalink
Re: Pipe all remaining requests if URI / condition is met [In reply to]

On 21.09.2011 19:24, Kevin wrote:

> I'm curious if its possible to set varnish to pipe all subsequent requests
> (ignoring any rules that say otherwise) if certain specific conditions are
> met (i.e. user visits a login page and is returned to the main page).

With the help of a vmod
(https://github.com/KristianLyng/libvmod-header), you could add a
special cookie to the response and match it early in vcl_recv().

import header;

...
if (req.http.Cookie ~ "(^|; )VCLPIPE=1") {
return(pipe);
}

...
if (req.url ~ "^/login") {
header.append(beresp.http.Set-Cookie,"VCLPIPE=1; path=/");
}


Hauke.
Attachments: signature.asc (0.19 KB)


lampe at hauke-lampe

Sep 24, 2011, 5:22 AM

Post #3 of 3 (514 views)
Permalink
Re: Pipe all remaining requests if URI / condition is met [In reply to]

Hello Kevin.

On 22.09.2011 06:36, Kevin wrote:

> I am using varnish 2.1.5 and am getting this make error :

vmods are a new feature since varnish 3.0 and not supported in earlier
versions.

I don't know if there's a way to add multiple headers to the response
with varnish 2.x. You'd probably have to encode everything into a single
Set-Cookie: header.


Hauke.
Attachments: signature.asc (0.19 KB)

Varnish misc RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.