How to enable gzip compression in nginx on a Plesk server




  • Avatar
    Markus Wernecke

    Thanks a lot! Great 'n' easy tutorial.

  • Avatar

    Isn't text/html most important ? It is missing from the code.

  • Avatar
    Ekaterina Babenko


    Hello Adrian! According to nginx official documentation, for the option gzip_types the mime-type text/html type is always compressed by default, so there is no need to specify it explicitly.
    You can check right here:

  • Avatar

    Is there any disadvantages to enable gzip globally? We often have reqests if we can enable gzip - there i want to insert this globally. 

    But will this harm any Websites in whatever way? Or is failproved ?

  • Avatar
    Ivan Postnikov


    When compressing is enabled, additional server RAM & CPU resources are utilized to compress websites content on the fly. If there are many websites on the server, the load may increase dramatically.

  • Avatar

    @Ivan uff. We have 300 Websites on a Server. Theres 64GB RAM. 

    Any example how i can determine if this will work or not? 

  • Avatar
    Robert Asilbekov

    @Lenor  If you mean how enabling gzip compression affect server performance - the only way is to monitor the server performance. Establish some performance baseline before enabling and see how the baseline will be changed after enabling gzip. 


    If you want to check whether gzip compression works you may use curl command. When gzip enabled you will see in the output 'Content-Encoding: gzip'. You can check individual files instead of pages to ensure they have been gzipped as well.

     #  curl -s -H "Accept-Encoding: gzip" -I http://domain.tld | grep Content-Encoding
    Content-Encoding: gzip

  • Avatar
    Berat Gashi

    Hi there,

    I need help on this one,

    I have a Plesk Server but the Additional nginx Directives is not showing at all even from the admin account!


    Plesk Info:

    OS Ubuntu 18.04.2 LTS
    Product Plesk Onyx 
    Version 17.8.11 Update #39
  • Avatar
    Ivan Postnikov

    Hello @Berat,

    Most probably this is because Nginx is not installed or disabled on your server.

    This article should help:

Please sign in to leave a comment.

Have more questions? Submit a request