Skip to content

Commit

Permalink
varnish: Set Access-Control-Allow-Origin in frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
paladox committed May 10, 2020
1 parent bd8b25f commit 62c2687
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/varnish/templates/default.vcl
Expand Up @@ -286,6 +286,10 @@ sub vcl_recv {

unset req.http.Proxy; # https://httpoxy.org/; CVE-2016-5385

if (req.url ~ "(?i)\.(gif|jpg|jpeg|pdf|png|css|js|json|woff|woff2|svg|eot|ttf|otf|ico|sfnt)$") {
set resp.http.Access-Control-Allow-Origin = "*";
}

# Normalize Accept-Encoding for better cache hit ratio
if (req.http.Accept-Encoding) {
if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|tbz|mp3|ogg)$") {
Expand Down

0 comments on commit 62c2687

Please sign in to comment.