# WP Super Cache rules. # Designed to be included from a 'wordpress-ms-...' configuration file. # Enable detection of the .gz extension for statically compressed content. # Comment out this line if static gzip support is not compiled into nginx. gzip_static on; set $supercacheuri ""; set $supercachefile "$document_root/blog/wp-content/cache/supercache/${http_host}${uri}index.html"; if (-e $supercachefile) { set $supercacheuri "/blog/wp-content/cache/supercache/${http_host}${uri}index.html"; } # If this is a POST request, pass the request onto WordPress. if ($request_method = POST) { set $supercacheuri ""; } # If there is a query string, serve the uncached version. if ($query_string) { set $supercacheuri ""; } # Logged in users and those who have posted a comment get the non-cached version. if ($http_cookie ~* comment_author_|wordpress_logged_in|wp-postpass_) { set $supercacheuri ""; } # Stop processing if the supercache file is valid. if ($supercacheuri) { rewrite ^ $supercacheuri break; }