A
A
Anatoly2018-11-21 06:27:16
Nginx
Anatoly, 2018-11-21 06:27:16

Why is nginx not serving static gz's?

nginx version: nginx/1.12.2
module --with-http_gzip_static_module included
In config:

spoiler
gzip on;
        gzip_disable 'msie6';
        gzip_proxied any;
        gzip_min_length 1000;
        gzip_http_version 1.0;
        gzip_buffers 8 64k;
        gzip_comp_level 4;
        gzip_vary on;
        gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript image/svg+xml font/otf  font/tff;

and
spoiler
location ~* \.(css|js)$ {
        expires 30d; 
        access_log   off;
        log_not_found    off;
        gzip_static on;
        add_header Cache-Control private; 
        add_header Vary Accept-Encoding;
}

Nginx packs and gives, for example, the style.css file is 23Kb, but I get 6.5Kb in the browser.
I decided to check the static gz, the size is 3.5Kb.
But when checking by the inspector, I see all the same 6.5Kb.
Why?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question