From 1bfe29f2eb0ff5cb0c7f38fc07bec6649e7e13f1 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sat, 11 Dec 2021 10:17:08 -0500 Subject: [PATCH] rename push cookie for clarity --- nginx/nginx.conf | 8 ++++++-- nginx/snippets/preload.conf | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/nginx/nginx.conf b/nginx/nginx.conf index b85a4c95..674b2e8d 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -77,13 +77,17 @@ http { /index.html ", ; rel=preload; as=image"; } + map $http_cookie $clear_legacy_push_cookie { + ~__Host-preload= "__Host-preload=; HttpOnly; Secure; SameSite=Lax; Path=/; Max-Age=0"; + } + map $http_cookie $nopush { - ~__Host-preload=1 1; + ~__Host-push=1 1; default 0; } map $nopush $push_cookie { - 0 "__Host-preload=1; HttpOnly; Secure; SameSite=Lax; Path=/"; + 0 "__Host-push=1; HttpOnly; Secure; SameSite=Lax; Path=/"; } map $nopush $push_stylesheet { diff --git a/nginx/snippets/preload.conf b/nginx/snippets/preload.conf index 96db1dc0..7e3f9a06 100644 --- a/nginx/snippets/preload.conf +++ b/nginx/snippets/preload.conf @@ -1,4 +1,5 @@ add_header Link "<{{path|/main.css}}>; rel=preload; as=style; integrity={{integrity|/main.css}}, ; rel=preload; as=font; crossorigin, ; rel=preload; as=font; crossorigin, <{{path|/mask-icon.svg}}>; rel=preload; as=image$preload_resources_uri" always; +add_header Set-Cookie $clear_legacy_push_cookie always; add_header Set-Cookie $push_cookie always; http2_push $push_stylesheet; http2_push $push_font_regular;