[FastAdmin插件] 可乐缓存插件-Nginx Rewrite设置教程

分类:插件使用浏览量:1110发布于:1年前

在插件配置里开启Rewrite模式,然后添加定时任务

/www/server/php/74/bin/php /www/wwwroot/www.xxx.com/public/index.php asdons/kelcache/task/check

将 /www/server/php/74/ 和 /www/wwwroot/www.xxx.com/ 换成你自己的php目录和网站目录

Rewite代码(伪静态)

location ~* (runtime|application)/ {
    return 403;
}
location / {
    set $cache /kelcache/$scheme/$host/$uri/index.html;

    # 非get请求不缓存(必选,否则表单不能提交)
    if ($request_method != 'GET') {
        set $cache 'No Cache';
    }

    # 有get参数不缓存(可选,不选可能会造成搜索错误)
    if ($query_string != '') {
        set $cache 'No Cache';
    }

    # 登录用户不缓存(可选)
    if ($http_cookie ~* '(^|;\s*)token=(.*?)($|;)') {
        set $cache 'No Cache';
    }

    if (-f $document_root$cache) {
        rewrite ^.*$ $cache last; break;
    }
    if (!-e $request_filename){
        rewrite ^(.*)$  /index.php?s=$1  last;   break;
    }
}
文章下方广告位
 上一篇:AJAX加载 下一篇:zblogphp如何定期把采集来的图片上传到腾讯云COS(对象存储) 

我来回答

猜你喜欢

最近更新

关注我们

qrcode

扫码进入插件售后群

控制面板
您好,欢迎到访网站!
  查看权限
最近发表
标签列表