Re: hiding varnish headers from requests

2007-12-13 Thread Jobe Bittman
Edit your vcl file and modify deliver like so.

sub vcl_deliver {
remove resp.http.X-Varnish;
remove resp.http.Via;
}


On 11/2/07, Damien Wetzel <[EMAIL PROTECTED]> wrote:
>
> Hello,
> I wondered if there is a way to prevent Varnish from
> puting headers like :
> X-varnish
> Via: 1.1 varnish
> in its responses to clients.
> thanks,
> --
>
>
> ~~
> Damien WETZEL (ATANAR TECHNOLOGIES)("`-/")_.-'"``-._
> http://www.atanar.com  . . `; -._)-;-,_`)
>   (v_,)'  _  )`-.\  ``-'
> Phone:+33 6 62 29 61 77   _.- _..-_/ / ((.'
> - So much to do, so little time -   ((,.-'   ((,/
> ~
> ___
> varnish-misc mailing list
> varnish-misc@projects.linpro.no
> http://projects.linpro.no/mailman/listinfo/varnish-misc
>



-- 
Jobe Bittman
Chief Network Architect
ZenGarden, Inc.
(858) 200-6099
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


purge_url

2007-12-13 Thread Erik
I will stop bothering the helpful guys at the irc for a minute and ask a 
question here ;) 

My VCL conf looks like this:
sub vcl_recv {
#Change the host header to www.mysite.com
if(req.http.host == "10.1.1.54" || req.http.host == "test.mysite.com") {
set req.http.host = "www.mysite.com";
}

#Purge specified files from acl purge.
#Purge = Delete the specified url from the cache
if(req.request == "PURGE") {
if(client.ip ~ purge) {
purge_url(req.url);
}
}

sub vcl_miss {
#set http version 1.1
set bereq.proto = "HTTP/1.1";

if (req.request == "PURGE") {
error 404 "The url could not be found in the cache.";
}
}

sub vcl_hit {
if (req.request == "PURGE") {
set obj.ttl = 0s;
error 200 "Purged successfully!";
}
}

}
# End of VCL Conf

I receive a 404 error "The url could not be found in the cache." when I try to 
PURGE the url.
PURGE http://www.mysite.com/data/hello.gif HTTP/1.1

This is the varnishlog when I try to purge:

  12 RxRequestc PURGE
   12 RxURLc /data/hello.gif
   12 RxProtocol   c HTTP/1.1
   12 VCL_call c recv
   12 VCL_acl  c MATCH purge "84.xx.xx.xx"
   12 VCL_return   c lookup
   12 VCL_call c hash
   12 VCL_return   c hash
   12 Debugc "Hash: /data/hello.gif#10.1.1.54:80#"
   12 VCL_call c miss
0 Debug  "VCL_error(404, The url could not be found in the cache.)"
   12 VCL_return   c error
   12 Length   c 453
   12 TxProtocol   c HTTP/1.0
   12 TxStatus c 404
   12 TxResponse   c Not Found
   12 TxHeader c Server: Varnish
   12 TxHeader c Retry-After: 0
   12 TxHeader c Content-Type: text/html; charset=utf-8
   12 TxHeader c Content-Length: 453
   12 TxHeader c Date: Thu, 13 Dec 2007 11:34:50 GMT
   12 TxHeader c X-Varnish: 1188471893
   12 TxHeader c Age: nan
   12 TxHeader c Via: 1.1 varnish
   12 TxHeader c Connection: keep-alive

When I try to request it with GET i receive:

  12 ReqStart c 84.xx.xx.xx 32162 1188471894
   12 RxRequestc GET
   12 RxURLc /data/hello.gif
   12 RxProtocol   c HTTP/1.1
   12 RxHeader c Host: www.mysite.com
   12 RxHeader c User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; 
sv-SE; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11
   12 RxHeader c Accept: 
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
   12 RxHeader c Accept-Language: sv,en-us;q=0.7,en;q=0.3
   12 RxHeader c Accept-Encoding: gzip,deflate
   12 RxHeader c Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
   12 RxHeader c Keep-Alive: 300
   12 RxHeader c Connection: keep-alive
   12 RxHeader c 
Cookie:__utma=75765975.864378540.1197378455.1197453843.1197535348.6; 
   12 VCL_call c recv
   12 VCL_return   c lookup
   12 VCL_call c hash
   12 VCL_return   c hash
   12 Debugc "Hash Match: /data/hello.gif#www.mysite.com#"
   12 Hit  c 1188471893
   12 VCL_call c hit
   12 VCL_return   c deliver
   12 Length   c 905
   12 VCL_call c deliver
   12 VCL_return   c deliver
   12 TxProtocol   c HTTP/1.1
   12 TxStatus c 200
   12 TxResponse   c OK
   12 TxHeader c Server: Zeus/4.3
   12 TxHeader c Content-Type: image/gif
   12 TxHeader c Content-Language: sv-SE
   12 TxHeader c Content-Length: 905
   12 TxHeader c Date: Thu, 13 Dec 2007 11:37:26 GMT
   12 TxHeader c X-Varnish: 1188471894 1188471893
   12 TxHeader c Age: 43
   12 TxHeader c Via: 1.1 varnish
   12 TxHeader c Connection: keep-alive

The strange thing is that the host is different in PURGE Match and GET Match. I 
have used the same host on both requests. Does it have anything to do with the 
vcl code where Im changing the hostheader?

/ Erik

___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Purge multiple varnish servers

2007-12-13 Thread Håkon Andreas Jensen
Poul-Henning Kamp wrote:
> In message <[EMAIL PROTECTED]>, =?ISO-8859-1?Q?H=E5kon_Andreas_Jensen?= 
> writes:
>
>   
>> I'm trying to figure out a way to purge multiple Varnish servers.
>> Is it possible to have a master Varnish server that receives an URL
>> to purge and then passes the purge on to the other servers using
>> VCL.
>> 
>
> If you have looked at that original varnish documents, you'll spot a box
> labeled "cluster controller"
>
> That was more or less what it was inteded for.
>
> We havn't got around to writing it yet.
>   
Ok. Thanks for replying so quickly.

-Håkon

___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Purge multiple varnish servers

2007-12-13 Thread Poul-Henning Kamp
In message <[EMAIL PROTECTED]>, =?ISO-8859-1?Q?H=E5kon_Andreas_Jensen?= writes:

>I'm trying to figure out a way to purge multiple Varnish servers.
>Is it possible to have a master Varnish server that receives an URL
>to purge and then passes the purge on to the other servers using
>VCL.

If you have looked at that original varnish documents, you'll spot a box
labeled "cluster controller"

That was more or less what it was inteded for.

We havn't got around to writing it yet.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Purge multiple varnish servers

2007-12-13 Thread Håkon Andreas Jensen
I'm trying to figure out a way to purge multiple Varnish servers.
Is it possible to have a master Varnish server that receives an URL
to purge and then passes the purge on to the other servers using
VCL.

I know this can be done passing each server a purge command,
but I would like just to communicate with the master Varnish and
let it take care of the rest of the purge logic.

I'm quite new in this area, so please bare with me.

Thanks in advance for any hints and advices.

-Håkon


___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc