Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to disable the deflate module on a per site basis in Apache2?

I have a legacy website that uses custom mime type server side includes that are breaking with the deflate module enabled. My guess is that the included file is being encrypted twice: once when included and then again when the response is sent.

I can disable the deflate module for Apache2 as a whole and the issue goes away, but I'd rather not be required to disable for all sites.

Has anyone had any success disabling deflate with an Apache conf directive?


I've successfully disabled DEFLATE for the virtual site using SetEnv no-gzip 1:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/
    ErrorDocument 404 /404.html
    ScriptAlias /cgi-bin/ /var/www/cgi-bin/
    SetEnv no-gzip 1
    <Directory />
            Options +Includes
            SetOutputFilter INCLUDES
            AcceptPathInfo On

            AddType text/x-jbase-html .jhtml
            Action text/x-jbase-html /cgi-bin/

    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/access.log combined
share|improve this question

migrated from Jun 2 '11 at 0:20

This question came from our site for professional and enthusiast programmers.

up vote 2 down vote accepted

According to Apache documentation you could set internal variable no-gzip with SetEnv directive to disable compression.

share|improve this answer
I've tried a number of combinations using no-gzip with no success. Do you have suggestion for the directive syntax? – gurun8 Jun 2 '11 at 19:06
@gurun8 SetEnv no-gzip works for me (Apache 2.4.9). – Artem Aug 19 '14 at 14:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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