Re: A few users see a blank page

2008-02-14 Thread Marco Molinari
On Thu, Feb 14, 2008 at 11:16 AM, Poul-Henning Kamp [EMAIL PROTECTED] wrote:
 In message [EMAIL PROTECTED], Erik writes:

  - web server: Centos 4 + Apache 2.0.52 + PHP 4.3.9 + Varnish=
   1.1.2

  Ok, I think this bug has been fixed, as also indicated by ticket 188

Hi,
I can confirm it's fixed in trunk. I'm sorry I didn't test it earlier.

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


Re: Configure varnish to pipe a subdomain

2008-02-14 Thread Dag-Erling Smørgrav
Erik [EMAIL PROTECTED] writes:
 Neither am I a regex expert, but I dont think that the regex is the
 problem. You are using http.url instead of using http.host.  And if
 im not totally wrong, you dont need the ~ to check the host, you can
 use ==.

 Change this:
 if (req.http.url ~ admin.example.com$) {
 pipe;
 }
 To this:
 if (req.http.host == admin.example.com) {
 pipe;
 }

 And this:
 if (req.http.Cookie  req.http.url ~ admin.example.com$) {
 pipe;
 }

 To this:
 if (req.http.Cookie  req.http.host == admin.example.com) {
 pipe;
 }

A couple of issues:

 - a regexp is better if you get it right, because a regexp match
   (unlike a string comparison) is case-insensitive by default.

 - pass is better than pipe, unless pipe is required for other
   reasons, in which case Connection: close should be added to the
   request headers.

 - the second if will never evalutate to true, since the first one
   trumps it.

The correct code would be:

if (req.http.url ~ ^admin.example.com$) {
pass;
}

DES
-- 
Dag-Erling Smørgrav
Senior Software Developer
Linpro AS - www.linpro.no
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: A few users see a blank page

2008-02-14 Thread Marco Molinari
On Thu, Feb 14, 2008 at 12:02 PM, Dag-Erling Smørgrav [EMAIL PROTECTED] wrote:
  You didn't say which version you're using, but from this backend
  definition, it's certainly not trunk.  It would be very helpful to
  know whether you see the same behaviour with trunk.

Hi,
I tried trunk and I don't get any blank page with it. I'm sorry I
didn't try it earlier.




  if (req.http.Pragma == no-cache) {
  pipe;
  }

  Are you sure you want to do this?

  If the point of this is to allow the client to Shift-Reload, you
  should purge the URL to force a reload from the backend, instead of
  piping the request.

That's the point, I just needed a quick way to purge an URL.
Later I'll definetely purge it from the backend.

Thanks for your reply, I'm still learning a lot about Varnish,
especially the difference between pass and pipe. Actually the pipe
for POST and req.http.Expect were taken from the default vcl.
If I understand correctly pipe means that further data between
client and server is passed until the connection is closed, while
pass means that the current request will be passed, but further
requests in the same connection will be normally processed by the vcl
file (and could be looked-up, for example).
Is this correct? Would you please make some examples where pass and
pipe are preferred?

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


Re: A few users see a blank page

2008-02-14 Thread Dag-Erling Smørgrav
Marco Molinari [EMAIL PROTECTED] writes:
 Dag-Erling Smørgrav [EMAIL PROTECTED] writes:
  If the point of this is to allow the client to Shift-Reload, you
  should purge the URL to force a reload from the backend, instead of
  piping the request.
 That's the point, I just needed a quick way to purge an URL.

This won't do what you want; the client that used Pragma: no-cache
will see a new version, but other clients won't.

Additionally, I would recommend that you use an ACL to restrict
purging to specific clients.

 Thanks for your reply, I'm still learning a lot about Varnish,
 especially the difference between pass and pipe. Actually the pipe
 for POST and req.http.Expect were taken from the default vcl.

The *old* default VCL :) I haven't had time to update the
documentation.

 If I understand correctly pipe means that further data between
 client and server is passed until the connection is closed, while
 pass means that the current request will be passed, but further
 requests in the same connection will be normally processed by the vcl
 file (and could be looked-up, for example).

Absolutely correct.

 Is this correct? Would you please make some examples where pass and
 pipe are preferred?

pass is preferred whenever possible; pipe should only be used for
requests that Varnish can't handle at all because they don't follow
the ususal HTTP structure (CONNECT is the only example I can think of
at the moment)

In the past, pass could not handle POST requests at all; later, it
could handle them but poorly (insufficient error recovery).  The
current code in trunk handles POST requests correctly in pass mode.

DES
-- 
Dag-Erling Smørgrav
Senior Software Developer
Linpro AS - www.linpro.no
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


error page not delivered

2008-02-14 Thread Ramon A Hermon
 I am unable to get varnish to deliver the customized error page when
 requesting a non-existent url.

I should correct the above statement to I get a blank page when requesting a 
non-existent directory or html file in the url.

Also, I did not provide the varnish log entries before ,so it follows;
$ varnishd -V
varnishd (varnish-1.1.2)
Copyright (c) 2006-2007 Linpro AS / Verdens Gang AS

$ uname -a
Linux vh006.p 2.6.18-8.1.8.el5 #1 SMP Tue Jul 10 06:39:17 EDT 2007 x86_64 
x86_64 x86_64 GNU/Linux

Case #1 (Fails!)
30 SessionOpen  c X.X.X.X 57544
30 ReqStart c X.X.X.X 57544 1808069741
30 RxRequestc GET
30 RxURLc /notthere
30 RxProtocol   c HTTP/1.1
30 RxHeader c Host: mysite.com
30 RxHeader c User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; 
rv:1.8.1.11) Gecko/20080206 Firefox/2.0.0.11
30 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
30 RxHeader c Accept-Language: en-us,en;q=0.5
30 RxHeader c Accept-Encoding: gzip,deflate
30 RxHeader c Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
30 RxHeader c Keep-Alive: 300
30 RxHeader c Connection: keep-alive
30 RxHeader c Cookie: OAX=DCIHAke0f0IADHvs; s_cc=true; s_sq=%5B%5BB%5D%5D
30 VCL_call c recv lookup
30 VCL_call c hash hash
30 VCL_call c miss fetch
30 Backend  c 29 default
30 ObjProtocol  c HTTP/1.1
30 ObjStatusc 302
30 ObjResponse  c Moved Temporarily
30 ObjHeaderc Date: Thu, 14 Feb 2008 17:51:03 GMT
30 ObjHeaderc Server: Apache/2.2.4 (Unix) mod_ssl/2.2.4 OpenSSL/0.9.8b 
mod_jk/1.2.25
30 ObjHeaderc X-Powered-By: Servlet 2.4; JBoss-4.0.5.GA (build: 
CVSTag=Branch_4_0 date=200610162339)/Tomcat-5.5
30 ObjHeaderc Location: http://mysite.com/notthere/index.html
30 ObjHeaderc Content-Type: text/plain
30 ObjHeaderc Set-Cookie: Coyote-2-c0a81e3d=c0a8823f:0; path=/
30 TTL  c 1808069741 RFC 120 1203011475 1203011463 0 0 0
30 VCL_call c fetch insert
30 Length   c 0
30 VCL_call c deliver deliver
30 TxProtocol   c HTTP/1.1
30 TxStatus c 302
30 TxResponse   c Moved Temporarily
30 TxHeader c Server: Apache/2.2.4 (Unix) mod_ssl/2.2.4 OpenSSL/0.9.8b 
mod_jk/1.2.25
30 TxHeader c X-Powered-By: Servlet 2.4; JBoss-4.0.5.GA (build: 
CVSTag=Branch_4_0 date=200610162339)/Tomcat-5.5
30 TxHeader c Location: http://mysite.com/notthere/index.html
30 TxHeader c Content-Type: text/plain
30 TxHeader c Content-Length: 0
30 TxHeader c Date: Thu, 14 Feb 2008 17:51:15 GMT
30 TxHeader c X-Varnish: 1808069741
30 TxHeader c Age: 0
30 TxHeader c Via: 1.1 varnish
30 TxHeader c Connection: keep-alive
30 ReqEnd   c 1808069741 1203011475.595798969 1203011475.600512028 
0.000309944 0.004663944 0.49114

30 ReqStart c X.X.X.X 57544 1808069742
30 RxRequestc GET
30 RxURLc /notthere/index.html
30 RxProtocol   c HTTP/1.1
30 RxHeader c Host: mysite.com
30 RxHeader c User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; 
rv:1.8.1.11) Gecko/20080206 Firefox/2.0.0.11
30 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
30 RxHeader c Accept-Language: en-us,en;q=0.5
30 RxHeader c Accept-Encoding: gzip,deflate
30 RxHeader c Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
30 RxHeader c Keep-Alive: 300
30 RxHeader c Connection: keep-alive
30 RxHeader c Cookie: OAX=DCIHAke0f0IADHvs; s_cc=true; s_sq=%5B%5BB%5D%5D
30 VCL_call c recv lookup
30 VCL_call c hash hash
30 VCL_call c miss fetch
30 Backend  c 29 default
30 ObjProtocol  c HTTP/1.0
30 ObjStatusc 404
30 ObjResponse  c /WEB-INF/templatesnotthere/index
30 ObjHeaderc Date: Thu, 14 Feb 2008 17:51:03 GMT
30 ObjHeaderc Server: Apache/2.2.4 (Unix) mod_ssl/2.2.4 OpenSSL/0.9.8b 
mod_jk/1.2.25
30 ObjHeaderc Set-Cookie: 
JSESSIONID=A23A24A92C07FF3836FA98C596F82503.jboss01; Path=/
30 ObjHeaderc Cache-Control: max-age=600
30 ObjHeaderc Expires: Thu, 14 Feb 2008 18:01:03 GMT
30 ObjHeaderc Content-Type: text/html
30 TTL  c 1808069742 RFC 586 1203011476 1203011463 1203012063 600 0
30 VCL_call c fetch insert
30 Length   c 0
30 VCL_call c deliver deliver
30 TxProtocol   c HTTP/1.0
30 TxStatus c 404
30 TxResponse   c /WEB-INF/templatesnotthere/index
30 TxHeader c Server: Apache/2.2.4 (Unix) mod_ssl/2.2.4 OpenSSL/0.9.8b 
mod_jk/1.2.25
30 TxHeader c Cache-Control: max-age=600
30 TxHeader c Expires: Thu, 14 Feb 2008 18:01:03 GMT
30 TxHeader c Content-Type: text/html
30 TxHeader c Date: Thu, 14 Feb 2008 17:51:16 GMT
30 TxHeader c X-Varnish: 1808069742
30 TxHeader c Age: 0
30 TxHeader c Via: 1.1 varnish
30 TxHeader c Connection: keep-alive
30 ReqEnd   c 1808069742 1203011475.610707998 1203011476.752576113 
0.010195971 1.141789913 0.78201

Case #2 (Works!)
21 SessionOpen  c X.X.X.X 57601
21 ReqStart c X.X.X.X