summaryrefslogtreecommitdiff
path: root/nginx/snippets
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2021-12-05 02:48:44 -0500
committerDaniel Micay <danielmicay@gmail.com>2021-12-05 02:48:44 -0500
commit7010b230c526d716f5899c1f4ea104a965625a23 (patch)
tree26df258bf3d764b6250c08cd7aacd98ae026eaa1 /nginx/snippets
parent27c50cd9a7a464ef47db416f24ee3bff8f8bbcca (diff)
use http2_push instead of http2_push_preload
This avoids needing to conditionally add nopush to each preloaded resource in the Link header. There's also no support for pushing JavaScript modules via http2_push_preload since nginx doesn't have support for rel=modulepreload.
Diffstat (limited to 'nginx/snippets')
-rw-r--r--nginx/snippets/preload.conf7
1 files changed, 5 insertions, 2 deletions
diff --git a/nginx/snippets/preload.conf b/nginx/snippets/preload.conf
index 8b369f5a..67ba6fd4 100644
--- a/nginx/snippets/preload.conf
+++ b/nginx/snippets/preload.conf
@@ -1,3 +1,6 @@
-add_header Link $preload_resources always;
+add_header Link "<{{path|/main.css}}>; rel=preload; as=style; integrity={{integrity|/main.css}}, </fonts/roboto-v29-regular-latin.woff2>; rel=preload; as=font; crossorigin, </fonts/roboto-v29-bold-latin.woff2>; rel=preload; as=font; crossorigin, <{{path|/mask-icon.svg}}>; rel=preload; as=image" always;
add_header Set-Cookie $push_cookie always;
-http2_push_preload on;
+http2_push $push_stylesheet;
+http2_push $push_font_regular;
+http2_push $push_font_bold;
+http2_push $push_mask_icon;