Skip to content

Commit 2c54504

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

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

nginx/nginx.conf

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,15 @@ 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+
242+
234243
location ~ "\.webmanifest$" {
235244
include snippets/security-headers.conf;
236245
add_header Cross-Origin-Resource-Policy "same-origin" always;
@@ -250,14 +259,6 @@ http {
250259
add_header Cache-Control "public, max-age=31536000";
251260
}
252261

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-
261262
location ~ "\.png$" {
262263
include snippets/security-headers.conf;
263264
# avoid breaking image hotlinking such as https://github.com/TryGhost/Ghost/issues/12880

0 commit comments

Comments
 (0)