基于帝国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