Skip to content

Commit

Permalink
use prefix match for fonts instead of regex
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed May 18, 2021
1 parent fc67d48 commit 2c54504
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,15 @@ http {
}
}

location ^~ /fonts/ {
include snippets/security-headers.conf;
add_header Cross-Origin-Resource-Policy "same-origin" always;
add_header Cache-Control "public, max-age=31536000, immutable";
gzip_static off;
brotli_static off;
}


location ~ "\.webmanifest$" {
include snippets/security-headers.conf;
add_header Cross-Origin-Resource-Policy "same-origin" always;
Expand All @@ -250,14 +259,6 @@ http {
add_header Cache-Control "public, max-age=31536000";
}

location ~ "\.woff2$" {
include snippets/security-headers.conf;
add_header Cross-Origin-Resource-Policy "same-origin" always;
add_header Cache-Control "public, max-age=31536000, immutable";
gzip_static off;
brotli_static off;
}

location ~ "\.png$" {
include snippets/security-headers.conf;
# avoid breaking image hotlinking such as https://github.com/TryGhost/Ghost/issues/12880
Expand Down

0 comments on commit 2c54504

Please sign in to comment.