Last active
August 29, 2015 14:22
-
-
Save eterps/ac7d1af7b9bab6f73455 to your computer and use it in GitHub Desktop.
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
backend s3 { .host = "s3.amazonaws.com"; .port = "80"; } | |
sub vcl_recv { | |
if (req.url ~ ".(css|gif|ico|jpg|jpeg|js|png|swf|txt)$") { | |
unset req.http.cookie; | |
unset req.http.cache-control; | |
unset req.http.pragma; | |
unset req.http.expires; | |
unset req.http.etag; | |
unset req.http.X-Forwarded-For; | |
set req.backend = s3; | |
set req.http.host = "my_bucket.s3.amazonaws.com"; | |
lookup; | |
} | |
} | |
sub vcl_fetch { | |
unset obj.http.X-Amz-Id-2; | |
unset obj.http.X-Amz-Meta-Group; | |
unset obj.http.X-Amz-Meta-Owner; | |
unset obj.http.X-Amz-Meta-Permissions; | |
unset obj.http.X-Amz-Request-Id; | |
set obj.ttl = 1w; | |
set obj.grace = 30s; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://www.ducea.com/2009/08/04/using-varnish-in-front-of-your-amazon-s3-static-content/