Proxying POST body through Varnish

Paul Carey paul.p.carey at
Mon Apr 12 20:17:31 CEST 2010


I've been trying out Varnish with CouchDB. CouchDB is a
document-oriented data store where documents are keyed by id. To
retrieve a list of documents from CouchDB a POST is made to
/db_name/_all_docs with a JSON encoded list of keys as the body.

For example:

curl -X POST -d '{"keys":["bar","foo"]}'

I'd like Varnish to cache these requests. My VCL config defines
vcl_recv and doesn't 'pass' on POSTs that match _all_docs. However,
CouchDB doesn't like the POST requests proxied through Varnish,
returning an error message stating 'invalid UTF-8 JSON'. I suspect
Varnish is stripping the POST body. I say this because when I run
varnishlog I see a Rx Content-Length header received by Varnish but
not a corresponding Tx header proxied to CouchDB.

If it's likely that this is what's happening, is there any many to get
Varnish to pass the POST body along?

Many thanks


More information about the varnish-misc mailing list