I'm brand-new to CiviCRM and really appreciate all the amazing work that's been done on this project!

I've been working on our implementation on a test server for a while now, but when I started implementing things on our production server, which is managed WordPress on Dreamhost (DreamPress), I'm running into issue related to modsecurity and Varnish cache I was hoping someone could help with.

For one example of the issue, I created a new contribution page and the test drive link works fine, but when I try to go to the live page () I get this error (throwing Xs in for a couple of values):

[Tue Jun 05 16:24:46 2018] [error] [client XXX.XXX.XXX.XXX] ModSecurity: Error reading request body: Partial results are valid but processing is incomplete [hostname "kptz.org"] [uri "/wp-admin/admin-ajax.php"] [unique_id "XXXXXXXXXXXXXXXXXX"]

I emailed Dreamhost support and their response was "... the plugin is using PHP sessions and setting session cookies that are conflicting with the Varnish cache. The cookies are setting 'no-cache' parameters, which are preventing Varnish from caching the site successfully. Previously, the plugin developers had posted in the forums regarding fixing the use of cookies for previous versions of the civicrm plugin. You can contact the developers and ask if the use of cookies can be adjusted for version 5.1.2 of the plugin."

They also said that they can add Varnish rules to my setup if they know what to add.

I suppose my first question is would I be better off using CiviCRM 4.6.36, i.e. is this something that is not an issue in the older version? If using the older version won't help, is there any guidance as to how to address this issue, or any sample Varnish rules available?

Thanks in advance for any assistance anyone can provide, and thanks again for CiviCRM!

3 Answers 3


You can certainly try to set up rules to bypass the reverse proxy, but at the same time, I think it will be more cost-effective to change hosting. Varnish problems aren't going to be the only issue you have when you have managed hosting that is specially tuned for WordPress hosting.

CiviCRM and WordPress work nicely together because they rely on the same LAMP stack and it's valuable to have your CRM and website tightly integrated. However, from another perspective, a CRM and a website have opposite performance needs. A website needs to serve the same few dozen pages to thousands of visitors. A CRM needs to pull from among thousands of contacts' information for a handful of users.

Managed WordPress hosting (whether through Dreamhost, WP Engine, or others) attempts to maximize website performance by caching as much as possible so that the most commonly-visited pages can be delivered whole without querying the database. This tilts the process completely towards the handful of content, lots of visitors use case for a website.

For a CRM, there's the issue you're facing where you have to tell the reverse proxy to skip various pages and widgets that are driven by CiviCRM. But when you fix that, at least for certain pages you've defeated the performance tricks that you're paying your host to implement.

The entire business model of this kind of hosting is to rely on these tools to get maximum performance out of minimal hardware. Without the caching, you're just left with cheap hosting. That's not going to serve you well as you try to use CiviCRM.

Your better bet is to host with something a little more substantial. What my colleagues and I have recommended for years is a virtual private server (VPS or cloud server) with at least 4GB of RAM and a dual-core processor. You can get these for around $20 per month at Linode, AWS, DigitalOcean, and elsewhere. They require setting up the whole LAMP stack, but that's something lots of us who support CiviCRM can do.

Once you've done this, you'll have better performance, a stack that is more broadly supported and used, and the ability to set up a practically unlimited number of development sites, extra domains, and so forth.

  • Andrew gave a really good answer - however, I will share that there are good shared hosts out there, some of which are CiviCRM contributors and partners, that offer great shared hosting services. As Andrew pointed out however, I would not use managed Wordpress hosting and the 4.6 line of Civi or LTS may not have a future after 2018. civicrm.org/blog/jackrabbithanna/…
    – themak
    Jun 11, 2018 at 19:17

Just thought I'd follow up on this and let folks know where I wound up -- after a lot of research and some outside assistance it turns out that it was actually the photo slider plugin (Slider Revolution) I was using on our homepage that was causing CiviCRM to break, and switching to Meta Slider fixed that issue. We also discovered that Varnish might have taken some tweaking as well to make sure everything worked correctly, so I wound up moving the site from DreamPress over to Amazon Lightsail, and I'm really happy with Lightsail.

Thanks to everyone for all the help thinking through this!


I don't think using an older version makes sense but I would give serious consideration to changing your hosting. In general using a host that does not support CiviCRM well can be quite expensive and there are several providers that do specialise in CiviCRM hosting

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.