好吧,很多人问我, WP Super Cache在AMH的Nginx下的使用规则,今天就发一弹!

  • A+
所属分类:WordPres

好吧,很多人问我, WP Super Cache在AMH的Nginx下的使用规则,今天就发一弹

# Rest of your config lines above
set $cache_uri $request_uri;
 
# POST请求和带查询字符串的URL总是转到PHP
if ($request_method = POST) {
    set $cache_uri 'null cache';
}  
if ($query_string != "") {
    set $cache_uri 'null cache';
}  
 
# 不要缓存包含以下段的uri
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
    set $cache_uri 'null cache';
}  
 
# 针对已登录用户(发表过评论),可以不静态化。在访问量高峰时可注释掉
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") {
    set $cache_uri 'null cache';
}
 
# 如果请求的文件已存在直接返回,将请求传递给<a href="https://www.sxsay.com/tag/wordpres/" title="查看与 WordPres 相关的文章" target="_blank">WordPres</a>s
location / {
    try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php ;
} 

感谢党,感谢祖国,给大家使用规则!
好吧,很多人问我, WP Super Cache在AMH的Nginx下的使用规则,今天就发一弹!

weinxin
QQ群:20764411
QQ群扫码加群

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

*