How to disable mod_deflate in apache2?

后端 未结 3 1520
深忆病人
深忆病人 2020-12-03 02:19

How can I disable mod_deflate in Apache2

  • For files in a specific directory

OR

  • For all files that have extension of, for example
相关标签:
3条回答
  • 2020-12-03 02:23

    Don't know if this is a general solution, but it worked for me at least, to turn of mod_deflate for .py-files within a .htaccess file in a certain folder:

    SetEnvIfNoCase Request_URI "\.py$" no-gzip dont-vary
    
    0 讨论(0)
  • 2020-12-03 02:42

    You could set the environment variable no-gzip for that directory/type of file:

    # for URL paths that begin with "/foo/bar/"
    SetEnvIf Request_URI ^/foo/bar/ no-gzip=1
    
    # for files that end with ".py"
    <FilesMatch \.py$>
        SetEnv no-gzip 1
    </FilesMatch>
    
    0 讨论(0)
  • Quote from: scottlinux.com

    Disable Compression: To disable compression in Apache, typically you just need to disable the module mod_deflate...

    Debian/Ubuntu:

    $ sudo a2dismod deflate
    Module deflate disabled.
    Run '/etc/init.d/apache2 restart' to activate new configuration!
    
    $ sudo /etc/init.d/apache2 restart
    
    0 讨论(0)
提交回复
热议问题