最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Why does nginx still gzip responses when gzip_proxied conditions aren’t met? - Stack Overflow

programmeradmin1浏览0评论

I'm currently learning about the gzip compression in nginx.
I configured nginx as bellow:

 server {
    listen  12300;
    server_name  192.168.0.199;

    gzip            on;
    gzip_buffers    32 4k;
    gzip_comp_level 5;
    gzip_disable    "MSIE [1-6]\.";
    gzip_http_version  1.1;
    gzip_min_length 500;
    gzip_proxied    expired no-cache no-store private auth;
    gzip_types      text/plain text/css text/xml text/javascript application/xml application/javascript application/json;
    gzip_vary       on;

    location / {
        root /test/dist;
        index index.html index.htm;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /etc/nginx/html/50x.html;
    }
 }

And then, I used the Postman to simulate a request. Based on my understanding, the response should not be gzipped because the request and response do not meet the conditions specified in the gzip_proxied configuration. However, the response is still being gzipped. I want to know the reason. Anyone can help me?

发布评论

评论列表(0)

  1. 暂无评论