Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

UPDATE

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

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName www.domain.com
    DocumentRoot /var/www/domain.com/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/jBase.pl
    </Directory>

    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
</VirtualHost>
share|improve this question

migrated from stackoverflow.com Jun 2 '11 at 0:20

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

1 Answer 1

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
2  
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 at 14:58

Your Answer

 
discard

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.