Created
October 13, 2010 12:52
-
-
Save sarahkadar/623974 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name blog.ktamas.com; | |
root /var/www/blog.ktamas.com; | |
include /etc/nginx/fastcgi_php; | |
location / { | |
gzip on; | |
gzip_http_version 1.0; | |
gzip_vary on; | |
gzip_comp_level 3; | |
gzip_proxied any; | |
gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; | |
gzip_buffers 16 8k; | |
index index.php; | |
set $totalcache_file ''; | |
set $totalcache_uri $request_uri; | |
if ($request_method = POST) { | |
set $totalcache_uri ''; | |
} | |
# Using pretty permalinks, so bypass the cache for any query string | |
if ($query_string) { | |
set $totalcache_uri ''; | |
} | |
if ($http_cookie ~* "comment_author_|wordpress|wp-postpass_" ) { | |
set $totalcache_uri ''; | |
} | |
# if we haven't bypassed the cache, specify our totalcache file | |
if ($totalcache_uri ~ ^(.+)$) { | |
set $totalcache_file /wp-content/w3tc-$http_host/pgcache/$1/_default_.html; | |
} | |
# only rewrite to the totalcache file if it actually exists | |
if (-f $document_root$totalcache_file) { | |
rewrite ^(.*)$ $totalcache_file break; | |
} | |
if (!-e $request_filename) { | |
rewrite ^(.*)$ /index.php last; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment