Open up the file /etc/nginx/nginx.conf
sudo vi /etc/nginx/nginx.conf
Comment that out gzip options
gzip on;
gzip_vary on;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml;
Restart NGINX server
sudo service nginx restart
Open up the site configuration file
sudo vi /etc/nginx/sites-enabled/your_website.conf
Set cache expiration to max
location ~* .(png|jpg|jpeg|gif|svg|webp)$ {
expires max;
add_header Cache-Control "public, no-transform";
log_not_found off;
access_log off;
}
location ~* .(js|css|pdf|html|swf|woff|woff2)$ {
expires max;
add_header Cache-Control "public, no-transform";
log_not_found off;
access_log off;
}