20200221 fastcgicache 指定页面cache配置

http{
...
fastcgi_cache_path /data/proxy_cache_path levels=1:2 keys_zone=cache_one:100m inactive=10m max_size=1g;
...
}



 set $skip_cache 0;
    if ($request_uri ~* ".*\&ncache=true(.*)") {
      set $skip_cache 1;
    }
fastcgi_cache_key $scheme$request_method$host$request_uri;


      location ~ .+\.php($|/) {
           #limit_conn perserver 250 ;
           root            /var/www/seckill/;
           fastcgi_index index.php;
           fastcgi_split_path_info ^(.+\.php)(.*)$;
           fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
           fastcgi_param   PATH_INFO       $fastcgi_path_info;
           fastcgi_param   PATH_TRANSLATED $document_root$fastcgi_path_info;
           fastcgi_pass   127.0.0.1:9000;
           include        fastcgi_params;


      fastcgi_cache cache_one;
      fastcgi_cache_bypass $skip_cache;
      fastcgi_no_cache $skip_cache;
      fastcgi_cache_valid 200 1m ;
      add_header X-Cache $upstream_cache_status;


        }
文档更新时间: 2020-02-21 08:23   作者:月影鹏鹏