Skip to content

Instantly share code, notes, and snippets.

@eterps
Last active August 29, 2015 14:22
Show Gist options
  • Save eterps/ac7d1af7b9bab6f73455 to your computer and use it in GitHub Desktop.
Save eterps/ac7d1af7b9bab6f73455 to your computer and use it in GitHub Desktop.
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