Skip to content

Commit bbe3a68

Browse files
committed
use prefix match for fonts instead of regex
1 parent fc67d48 commit bbe3a68

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

nginx/nginx.conf

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,14 @@ http {
231231
}
232232
}
233233

234+
location ^~ /fonts/ {
235+
include snippets/security-headers.conf;
236+
add_header Cross-Origin-Resource-Policy "same-origin" always;
237+
add_header Cache-Control "public, max-age=31536000, immutable";
238+
gzip_static off;
239+
brotli_static off;
240+
}
241+
234242
location ~ "\.webmanifest$" {
235243
include snippets/security-headers.conf;
236244
add_header Cross-Origin-Resource-Policy "same-origin" always;
@@ -250,14 +258,6 @@ http {
250258
add_header Cache-Control "public, max-age=31536000";
251259
}
252260

253-
location ~ "\.woff2$" {
254-
include snippets/security-headers.conf;
255-
add_header Cross-Origin-Resource-Policy "same-origin" always;
256-
add_header Cache-Control "public, max-age=31536000, immutable";
257-
gzip_static off;
258-
brotli_static off;
259-
}
260-
261261
location ~ "\.png$" {
262262
include snippets/security-headers.conf;
263263
# avoid breaking image hotlinking such as https://github.com/TryGhost/Ghost/issues/12880

0 commit comments

Comments
 (0)