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;