add preload headers for core fonts

This commit is contained in:
Daniel Micay 2021-02-15 03:25:22 -05:00
parent 18218710eb
commit 0c006f9afd
2 changed files with 10 additions and 4 deletions

View File

@ -208,12 +208,14 @@ http {
location = /404 {
internal;
http2_push /grapheneos.css?29;
include snippets/security-headers.conf;
include snippets/preload.conf;
}
location = /404.html {
internal;
http2_push /grapheneos.css?29;
include snippets/security-headers.conf;
include snippets/preload.conf;
}
# broken link (now fixed) on https://noagendaphone.com/ with UTF-8 replacement character
@ -252,15 +254,15 @@ http {
add_header Content-Security-Policy "default-src 'none'; connect-src 'self' https://releases.grapheneos.org/; font-src 'self'; img-src 'self'; manifest-src 'self'; script-src 'self'; style-src 'self'; form-action 'none'; frame-ancestors 'none'; block-all-mixed-content; base-uri 'none'" always;
add_header Permissions-Policy "accelerometer=(), ambient-light-sensor=(), autoplay=(), battery=(), camera=(), display-capture=(), document-domain=(), encrypted-media=(), fullscreen=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), midi=(), payment=(), picture-in-picture=(), publickey-credentials-get=(), screen-wake-lock=(), sync-xhr=(), xr-spatial-tracking=()" always;
add_header Cache-Control "public, max-age=1800";
include snippets/preload.conf;
try_files $uri.html =404;
http2_push /grapheneos.css?29;
}
location / {
include snippets/security-headers.conf;
add_header Cache-Control "public, max-age=1800";
include snippets/preload.conf;
try_files $uri $uri.html $uri/ =404;
http2_push /grapheneos.css?29;
}
}

View File

@ -0,0 +1,4 @@
add_header Link "</grapheneos.css?29>; rel=preload; as=style" always;
add_header Link "</fonts/roboto_latin.woff2?20>; rel=preload; as=font; crossorigin" always;
add_header Link "</fonts/roboto_bold_latin.woff2?20>; rel=preload; as=font; crossorigin" always;
http2_push /grapheneos.css?29;