summaryrefslogtreecommitdiff
path: root/nginx/nginx.conf
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2021-12-11 09:50:51 -0500
committerDaniel Micay <danielmicay@gmail.com>2021-12-11 09:50:51 -0500
commita9a1a3987afc6023826941e137da4f6b156dda51 (patch)
treedba88cc1555253e854c781bfc0b35a9ba709a566 /nginx/nginx.conf
parent78070f6e5c6a50493a6a94feb1c632f697b02446 (diff)
add preload/push for main page phone image
Diffstat (limited to 'nginx/nginx.conf')
-rw-r--r--nginx/nginx.conf17
1 files changed, 17 insertions, 0 deletions
diff --git a/nginx/nginx.conf b/nginx/nginx.conf
index 22960619..b85a4c95 100644
--- a/nginx/nginx.conf
+++ b/nginx/nginx.conf
@@ -73,6 +73,10 @@ http {
if_modified_since before;
+ map $uri $preload_resources_uri {
+ /index.html ", </phone.png>; rel=preload; as=image";
+ }
+
map $http_cookie $nopush {
~__Host-preload=1 1;
default 0;
@@ -98,6 +102,10 @@ http {
0 "{{path|/mask-icon.svg}}";
}
+ map $nopush $push_phone {
+ 0 /phone.png;
+ }
+
server {
listen 80 backlog=4096;
listen [::]:80 backlog=4096;
@@ -302,6 +310,15 @@ http {
default_type application/json;
}
+ location = / {
+ include snippets/security-headers.conf;
+ add_header Cross-Origin-Resource-Policy "same-origin" always;
+ add_header Cache-Control "public, no-cache";
+ include snippets/preload.conf;
+ http2_push $push_phone;
+ try_files /index.html =404;
+ }
+
location = /install/web {
include snippets/security-headers-base.conf;
add_header Content-Security-Policy "default-src 'none'; child-src 'self'; 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;