- 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 ; }

QQ群:20764411
QQ群扫码加群
您可以选择一种方式赞助本站
支付宝扫一扫赞助
微信钱包扫描赞助
赏