How to configure Varnish not to cache a particular folder?

Solution 1:

You'd want something like this in your vcl_recv:

if (req.url ~ "^/path/to/exclude/") {
  return (pass);
}

You'll probably need to familiarize yourself with the basics of what the default VCL is doing and adjust for your content - for example, by default, it'll avoid caching anything when the client sends any cookies on the assumption that your content might vary based on sent cookies.