gzip JSON from NGINX

One weird trick to reduce web server response size by 80-90%!

Add:

gzip on;  
gzip_types application/json;  

to the http block in your nginx.conf (the gzip on; line is probably already there).

Where is nginx.conf? On the Ubuntu 14.04 machine I'm using running nginx 1.4.6 it's in /etc/nginx. Then reload with service nginx reload to pick up the change.

I've looked this up many times so I figured why not put it here so it's easier for me to find in the future.