Link Search Menu Expand Document
Table of contents

Enable gzip

vim /etc/nginx/nginx.conf
gzip on; 

** After gzip enabled **

Be aware when using request header: -H "Accept-Encoding: gzip, deflate"

Outputs actual stylesheet 
curl -H "Accept-Encoding: gzip, deflate" http;//
Outputs: Binary output can mess up your terminal

gzip config sample

event {...}

http {
    include mine.type; 

    gzip on;
    gzip_comp_level 3; #level 3 or 4 is good 

    gzip_types text/css; #define which type of file to compress 
    gzip_types text/javascript;
    # test: curl -I -H "Accpet-Encoding: gzip, deflate" 
    # returns: > content-encoding: gzip

    server {
        listen 80;
        root /sites/demo;