varnishncsa not logging POST requests?

Chris Hecker checker at d6.com
Thu May 5 02:16:35 CEST 2011


Ah, it looks like I should be 'pass'ing POSTs, not 'pipe'ing them.  This 
makes them show up in the log.

Is this the recommended code 
(http://open.blogs.nytimes.com/2010/09/15/using-varnish-so-news-doesnt-break-your-server/)?

     # Pass any requests that Varnish does not understand straight to 
the back end.
     if (req.request != "GET" && req.request != "HEAD" &&
         req.request != "PUT" && req.request != "POST" &&
         req.request != "TRACE" && req.request != "OPTIONS" &&
         req.request != "DELETE") {
       return(pipe);
     }     /* Non-RFC2616 or CONNECT which is weird. */

     # Pass anything other than GET and HEAD directly.
     if (req.request != "GET" && req.request != "HEAD") {
       return(pass);      /* We deal only with GET and HEAD by default */
     }

Chris


On 2011/05/04 16:55, Chris Hecker wrote:
>
> I couldn't figure out why POSTs weren't showing up in my varnish logs,
> but from looking at the source, it looks like varnishncsa is hard coded
> to ignore "pipe"? The code is slightly different between 2.0.6 (sorry,
> I'm on an old version) and current, but both look like they toast the
> current logline if the session close is a "pipe" or "error" without a
> flag check to keep the txn.
>
> My VCL pipes POSTs, as do most, I assume. Is there any way to get these
> into the log short of modifing the source?
>
> Thanks,
> Chris
>
>




More information about the varnish-misc mailing list