varnishncsa not logging POST requests?

Chris Hecker checker at
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 

     # 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") {
     }     /* 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 */


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