Created
April 10, 2012 03:19
-
-
Save zaius/2348131 to your computer and use it in GitHub Desktop.
Serve rails assets with etags from nginx
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
location / { | |
if ($uri ~* "/assets/.*-(.*)\..*") { | |
expires max; | |
add_header Cache-Control public | |
add_header Etag $1; | |
} | |
} |
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
but looking at that doesn't make since. I don't know that that just applies to just that location