为什么nginx不缓存我的JSON URL?

时间:2016-10-05 12:50:00

标签: caching nginx proxy reverse-proxy

JSON Url缓存 - 缓存控制:max-age = 0,无缓存。 我的配置:ngnix.conf

location / {
             proxy_set_header Host $host:8092;
             proxy_pass http://172.16.1.121:8081/;
    #        root   html;
    #        index  index.html index.htm;
        }

location /app/index.php/market/mutualFund/Overview?bestPerformingajaxcall=1 {
            proxy_cache my_zone_2;
            proxy_buffering on;
            proxy_cache_valid 200 302 5m;
            proxy_set_header Host $host:8095;
            proxy_pass http://172.16.1.121:8081/app/index.php/market/mutualFund/Overview?bestPerformingajaxcall=1;
            proxy_read_timeout 300;
        }

默认

http {
    include       mime.types;
    default_type  application/octet-stream;
    fastcgi_read_timeout 2000000;
    proxy_connect_timeout       200000000;
    proxy_send_timeout          200000000;
    proxy_read_timeout          200000000;
    send_timeout                200000000;

    proxy_cache_path /home/tejora/app/nginx/cache levels=1:2 keys_zone=my_zone_2:8m max_size=50m;
    proxy_cache_key "$scheme$request_method$host$request_uri$is_args$args";
    proxy_cache_valid 200 302 10m;
    proxy_cache_valid 404 1m;
    sendfile        on;
    keepalive_timeout  65;
    gzip  on;

}

我想要缓存我的JOSN网址。没有缓存文件到文件夹中。

0 个答案:

没有答案