Skip to content

Instantly share code, notes, and snippets.

@zaius
Created April 10, 2012 03:19
Show Gist options
  • Select an option

  • Save zaius/2348131 to your computer and use it in GitHub Desktop.

Select an option

Save zaius/2348131 to your computer and use it in GitHub Desktop.
Serve rails assets with etags from nginx
location / {
if ($uri ~* "/assets/.*-(.*)\..*") {
expires max;
add_header Cache-Control public
add_header Etag $1;
}
}
@zaius

zaius commented Apr 15, 2012

Copy link
Copy Markdown
Author

Pretty sure the gzip stuff can be applied per location, but I just have it defined globally. Doesn't seem to cause any problems to do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment