Created
March 2, 2010 03:16
-
-
Save kfaustino/319084 to your computer and use it in GitHub Desktop.
nginx rewrite rules for rails page cache in public/cache
This file contains hidden or 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
# Place the following in the server block | |
if (-f $request_filename) { | |
break; | |
} | |
if (-f $document_root/cache/$uri/index.html) { | |
rewrite (.*) /cache/$1/index.html break; | |
} | |
if (-f $document_root/cache/$uri.html) { | |
rewrite (.*) /cache/$1.html break; | |
} | |
if (-f $document_root/cache/$uri) { | |
rewrite (.*) /cache/$1 break; | |
} | |
if (!-f $request_filename) { | |
proxy_pass http://mongrel-pt; | |
break; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment