Skip to content

Instantly share code, notes, and snippets.

@derekclee
Last active June 11, 2024 19:51
Show Gist options
  • Save derekclee/a19ebfd7d22679c82fda to your computer and use it in GitHub Desktop.
Save derekclee/a19ebfd7d22679c82fda to your computer and use it in GitHub Desktop.
Varnish Cache Set CORS headers
sub vcl_deliver {
if (req.url ~ "/fonts/") {
set resp.http.Access-Control-Allow-Origin = "*";
set resp.http.Access-Control-Allow-Methods = "GET, OPTIONS";
set resp.http.Access-Control-Allow-Headers = "Origin, Accept, Content-Type, X-Requested-With, X-CSRF-Token";
}
}
@sarabenelabbes
Copy link

Very Useful! Thank You!

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