How can I check that the nginx gzip_static module is working?

后端 未结 6 890
遇见更好的自我
遇见更好的自我 2021-01-30 00:58

How can I check that nginx is serving the .gz version of static files, if they exist?

I compiled nginx with the gzip static module, but I don\'t see any mention of the .

6条回答
  •  不要未来只要你来
    2021-01-30 01:26

    I would disable automatic compression and log gzip_ratio:

    http {
       gzip off;
       gzip_static on;
    
       log_format log_with_ratio "... $gzip_ratio ...";
    
       server {
          access_log /var/log/nginx/file.log log_with_ratio;
       }
    }
    

    Note, that you may override gzip, gzip_static and access_log per server and location levels.

提交回复
热议问题