How to check if nginx gzip module is working correctly
Nice way for debugging how compression works, based on Alexander Azarov link
http {
gzip off;
gzip_static on;
log_format log_with_ratio "$remote_addr - $request - ($gzip_ratio)";
server {
access_log /var/log/nginx/file.log log_with_ratio;
}
}
Follow logs with less on your server:
less /var/log/nginx/file.log
with / search your ip or path you are currently interested in, then press shift +f for follow mode.
and test url with curl:
curl -IL -H "accept-encoding: gzip" http://<some-url>
Written by fala
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Nginx
Authors
reiaguilera
279.4K
jamesdullaghan
90.14K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#