This page explains and shows which configurations are default for compression on NGINX. To work with what is written on it, we have to open /etc/nginx/nginx.conf:
gzip_buffers 16 8k;
With the code above, the content compression of specified types will be on, right after restarting NGINX (sudo /etc/init.d/nginx restart). But what now? How to test if the content is really being delivered compressed?
I’ll show two methods (there lots of methods):
1 – Access this page and type your domain to know if went right or not.
2 – With Google Chrome, open the Developer Tools, click on Network tab and refresh (F5) the page. Notice the Size tab that shows the size in black (compressed size) and the size in gray (real size), besides clicking on the file name and looking on HEADERS tab that GZIP is mentioned.
All set, you are delivering compressed content and getting better performance from the sites that are hosted on your NGINX server.