http {
    ...
    gzip on;
    gzip_http_version 1.1;
    gzip_min_length 1k;
    gzip_comp_level 2;
    gzip_types text/plain text/xml application/json application/javascript application/x-javascript text/css application/xml application/xml+rss text/javascript application/x-httpd-php image/jpeg image/gif image/png;
    gzip_vary on;
    gzip_disable "MSIE [1-6]\.";
    gzip_buffers 4 8k;
    ...
}
