fastcgi_cache 应用于帝国tag标签

基于帝国cms

环境用的lnmp一键安装包

#http里面增加
# levels    缓存层次
# keys_zone 缓存空间名和共享内存大小(热点内容放在内存)
# inactive  失效时间, 1d = 1天
# max_size  最大缓存空间(硬盘占用)
fastcgi_cache_path /usr/local/nginx/fastcgi_cache levels=1:2 keys_zone=TEST:10m inactive=5m;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;

#tag标签伪静态
rewrite ^/tags-(.*?)-(\d+)\.html$ /e/tags/index.php?tagname=$1&page=$2 break;

#在原来include enable-php上面增加这段
location ~ ^/e/tags/index.php(.*)
{
    try_files $uri =404;
    fastcgi_pass  unix:/tmp/php-cgi.sock;
    fastcgi_index index.php;
    include fastcgi.conf;
    fastcgi_cache TEST;
    fastcgi_cache_valid 200 302 1h;
    fastcgi_cache_min_uses 1;
    fastcgi_cache_use_stale error timeout invalid_header http_500;
    fastcgi_cache_key $host$request_uri;
}
include enable-php.conf;

参考地址
//配置参考
https://zhangge.net/5042.html

//参数参考
http://blog.csdn.net/clh604/article/details/9064595
 

转载于:https://my.oschina.net/waterPlants/blog/796276

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值