You can enable gzip compression for CSS and JavaScript files also. Apart from that any text data, e.g. XML files will also benefit from gzip compression. However, never turn on gzip compression on images or any kind of binary data.

Enable Gzip Compression

Most likely gzip is enabled on your server. If not, you can following codes in /etc/nginx/nginx.conf

gzip on turns on gzip compression. Later on, you can add gzip off under a server{..} block or location{..} to turn off gzip compression for one or more sites/regions.

gzip_typesis list of MIME-types for which you want to turn on compression. text/html is implied and cannot be turned off (unless you set gzip off). text/css and application/x-javascript enables gzip compression for CSS and javascript files respectively.