Skip to content

Instantly share code, notes, and snippets.

@ivanyv
Created June 29, 2011 21:12
Show Gist options
  • Save ivanyv/1054992 to your computer and use it in GitHub Desktop.
Save ivanyv/1054992 to your computer and use it in GitHub Desktop.
Exclusively cache Rails GET requests on nginx
config.action_controller.page_cache_directory = Rails.root.join('public', 'cache-GET')
# Inside the server directive:
location @rails {
passenger_enabled on;
}
try_files /cache-$request_method$uri /cache-$request_method$uri.html @rails;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment