I ran through the tutorial here - https://www.digitalocean.com/community/tutorials/how-to-add-the-gzip-module-to-nginx-on-ubuntu-14-04
and it says to add test files which go here
sudo truncate -s 1k /usr/share/nginx/html/test.css
then test like this
curl -H "Accept-Encoding: gzip" -I http://localhost/test.css
It seems localhost going here /usr/share/nginx/html/ ok that is fine…
And here it works! BUT on my actual server location here
I get gzip not working.
I have tried enabling gzip in the sites-available nginx server block config like this
gzip_min_length 1100; etc
It’s not clear if these commands should go in the location blocks or higher level server block. I tried both anyway but both don’t seem to work…
BUT if the root gzip is working for the tutorial on my server why is it not working in my website…
Thanks for ideas. [Edit] I am wondering if it is because the domain isn’t working yet and am testing the live ip address and because of this it is ignored? But if that were true the default SHOULD be working?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Click below to sign up and get $200 of credit to try our products over 60 days!