|
|
@ -2,7 +2,7 @@ |
|
|
|
|
|
|
|
set $cache_uri $request_uri; |
|
|
|
|
|
|
|
# POST Requests And Urls With A Query String Should Always Go To PHP |
|
|
|
# POST requests and URL with a query string should always go to php |
|
|
|
if ($request_method = POST) { |
|
|
|
set $cache_uri 'null cache'; |
|
|
|
} |
|
|
@ -11,17 +11,17 @@ if ($query_string != "") { |
|
|
|
set $cache_uri 'null cache'; |
|
|
|
} |
|
|
|
|
|
|
|
# Don't Cache Uris Containing The Following Segments |
|
|
|
# Don't cache URL containing the following segments |
|
|
|
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*.php|index.php|/feed/|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") { |
|
|
|
set $cache_uri 'null cache'; |
|
|
|
} |
|
|
|
|
|
|
|
# Don't Use The Cache For Logged In Users Or Recent Commenters |
|
|
|
# Don't use the cache for logged in users or recent commenter |
|
|
|
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") { |
|
|
|
set $cache_uri 'null cache'; |
|
|
|
} |
|
|
|
|
|
|
|
# Use Cached Or Actual File If They Exists, Otherwise Pass Request To WordPress |
|
|
|
# Use cached or actual file if they exists, Otherwise pass request to WordPress |
|
|
|
location / { |
|
|
|
try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php$args; |
|
|
|
} |
|
|
@ -31,6 +31,6 @@ location ~ \.php$ { |
|
|
|
include fastcgi_params; |
|
|
|
fastcgi_pass php; |
|
|
|
|
|
|
|
# Following Line Is Needed By WP SUPER CACHE Plugin |
|
|
|
# Following line is needed by WP Super Cache plugin |
|
|
|
fastcgi_param SERVER_NAME $http_host; |
|
|
|
} |
|
|
|