You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.0 KiB
37 lines
1.0 KiB
11 years ago
|
# Common WPSC NGINX CONFIGURATION
|
||
|
|
||
|
set $cache_uri $request_uri;
|
||
|
|
||
|
# POST Requests And Urls With A Query String Should Always Go To PHP
|
||
|
if ($request_method = POST) {
|
||
|
set $cache_uri 'null cache';
|
||
|
}
|
||
|
|
||
|
if ($query_string != "") {
|
||
|
set $cache_uri 'null cache';
|
||
|
}
|
||
|
|
||
|
# Don't Cache Uris 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
|
||
|
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
|
||
|
location / {
|
||
|
try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php$args;
|
||
|
}
|
||
|
|
||
|
location ~ \.php$ {
|
||
|
try_files $uri =404;
|
||
|
include fastcgi_params;
|
||
|
fastcgi_pass php;
|
||
|
|
||
|
# Following Line Is Needed By WP SUPER CACHE Plugin
|
||
|
fastcgi_param SERVER_NAME $http_host;
|
||
|
}
|