use prefix match for fonts instead of regex

This commit is contained in:
Daniel Micay 2021-05-18 02:45:10 -04:00
parent ea67f9c6b2
commit ca24fdebc5

View File

@ -238,6 +238,14 @@ http {
return 301 /;
}
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;
@ -257,14 +265,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