Skip to content

Instantly share code, notes, and snippets.

@kkxlkkxllb
Created October 25, 2012 06:22
Show Gist options
  • Select an option

  • Save kkxlkkxllb/3950825 to your computer and use it in GitHub Desktop.

Select an option

Save kkxlkkxllb/3950825 to your computer and use it in GitHub Desktop.
rails unicorn nginx config file cache
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