summaryrefslogtreecommitdiff
path: root/nginx
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2021-02-15 04:23:56 -0500
committerDaniel Micay <danielmicay@gmail.com>2021-02-15 04:23:56 -0500
commitf298ee4b2b6fda254692fcefcaf8aa61f4de6f3e (patch)
treeebd7e54d00cb3210c9c91a179724d4410b38d871 /nginx
parent2688ca04a500551fb562520a2cbef1b039cadd81 (diff)
use once per session preload / push
Diffstat (limited to 'nginx')
-rw-r--r--nginx/nginx.conf5
-rw-r--r--nginx/snippets/preload.conf5
2 files changed, 8 insertions, 2 deletions
diff --git a/nginx/nginx.conf b/nginx/nginx.conf
index 4e2e1372..149edce6 100644
--- a/nginx/nginx.conf
+++ b/nginx/nginx.conf
@@ -65,6 +65,11 @@ http {
if_modified_since before;
+ map $http_cookie $preload_resources {
+ "~*__Host-preload=1" "";
+ default "</grapheneos.css?29>; rel=preload; as=style, </fonts/roboto_latin.woff2?20>; rel=preload; as=font; crossorigin, </fonts/roboto_bold_latin.woff2?20>; rel=preload; as=font; crossorigin";
+ }
+
server {
listen 80 backlog=4096;
listen [::]:80 backlog=4096;
diff --git a/nginx/snippets/preload.conf b/nginx/snippets/preload.conf
index f0409213..12406fca 100644
--- a/nginx/snippets/preload.conf
+++ b/nginx/snippets/preload.conf
@@ -1,2 +1,3 @@
-add_header Link "</grapheneos.css?29>; rel=preload; as=style, </fonts/roboto_latin.woff2?20>; rel=preload; as=font; crossorigin, </fonts/roboto_bold_latin.woff2?20>; rel=preload; as=font; crossorigin" always;
-http2_push /grapheneos.css?29;
+add_header Link $preload_resources always;
+add_header Set-Cookie "__Host-preload=1; HttpOnly; Secure; Path=/" always;
+http2_push_preload on;