Cannot post new content after installing varnish Our drupal 7 site was running so slow it was almost unresponsive, so I had to install varnish 2.1.5 this weekend. I got it up and running, and everything is now lightning fast, users can login and everything else is good... except that none of our authors can post new content.

When new content is posted, whether it's from the admin overlay or the actual node/add/news path, the URL just reloads and nothing happens. The form data is all in the Request Payload, the SESSION cookie is set, Varnish supposedly isn't caching... and yet nothing happens. I even installed the varnish module for drupal, but that only seems to handle reporting, and not actually doing anything.

Here's my default.vcl file.

I'm not seeing anything suspect in the vcl, but it certainly seems to be screwing something up.

Edit: I should point out that I don't have any issues changing settings in admin, or doing anything else, other than posting content, so it's not like all forms are broken. It might have something to do with ckeditor which is only present on the new content pages, but that seems like a stretch to me.

Edit 2: Realized I can create new blocks as admin, which uses the ckeditor which means that doesn't have anything to do with it. No new entries are getting put inserted into the node table and there's nothing suspicious in the watchdog logs.
I finally found a solution. Inside my default.vcl file I added the following block at the top of sub vcl_recv:

sub vcl_recv {

  # forward request directly to Apache if SESSION cookie is set.
  if (req.http.Cookie ~ "(SESS[a-zA-Z0-9]*)=") {
    return (pass);
  }

  ... # whatever else you need to do in vcl_recv
}


Basically I'm just checking to see if my session cookie is set (anyone else reading this might have one formatted differently) and if so, forwarding it to Apache. This seems to have fixed the problems as new content can be posted again. Not really sure why the elaborate cookie filtering I had in place (and which was working in every other case except posting new node content) didn't work, but this seems to be the solution, even if it feels a little heavy handed.