Search code examples
google-chromenginxgziphttp-compression

Nginx gzip not working in Chrome


As the title said, Nginx Gzip is not working, I have tried many configurations scattered on the internet none have worked, I'm really frustrated when simple things don't work.

gzip.conf:

gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 256;
gzip_types
    text/plain
    text/css
    application/json
    application/javascript
    application/x-javascript
    text/xml
    application/xml
    application/xml+rss
    text/javascript
    application/vnd.ms-fontobject
    application/x-font-ttf
    font/opentype
    image/svg+xml
    image/x-icon;

Chrome:

enter image description here

enter image description here

Chrome Audit: enter image description here

Curl: enter image description here

I have cleared the cache and everything still the same.

=======================

UPDATE:

I have tested for gzip compression at

http://checkgzipcompression.com/

and gave me:

enter image description here

but in Chrome it shows:

enter image description here


Solution

  • The culprit was my anti-virus, I thought it was not because at first, I have disabled it and the response are still not gzipped. But when i tried in a newly installed VM with the same chrome version in my workspace, the response got gzipped, and when I installed the anti-virus on that VM, the response was not gzipped again.