Using ModSecurity with mod_defalate can be challenging. An interesting post on the ModSecurity mailing list explains how this can be achieved.