From 68b323b8d55c4a1828dcd09bf86a2d9531461965 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sat, 14 Nov 2020 03:58:21 -0500 Subject: add full nginx configuration --- nginx/server.conf | 145 ------------------------------------------------------ 1 file changed, 145 deletions(-) delete mode 100644 nginx/server.conf (limited to 'nginx/server.conf') diff --git a/nginx/server.conf b/nginx/server.conf deleted file mode 100644 index 9bacec10..00000000 --- a/nginx/server.conf +++ /dev/null @@ -1,145 +0,0 @@ -server { - listen 80; - listen [::]:80; - server_name www.grapheneos.org grapheneos.org; - - root /var/empty; - - return 301 https://grapheneos.org$request_uri; -} - -server { - include /etc/nginx/snippets/https.conf; - server_name www.grapheneos.org; - - root /var/empty; - - include /etc/nginx/snippets/security-headers.conf; - - return 301 https://grapheneos.org$request_uri; -} - -server { - include /etc/nginx/snippets/https.conf; - server_name grapheneos.org; - - root /var/www/html; - error_page 403 =404 /404.html; - error_page 404 /404.html; - - charset utf-8; - include /etc/nginx/snippets/security-headers.conf; - gzip_static on; - gzip off; - - if ($request_uri ~ ^/(.*)\.html$) { - return 301 /$1; - } - - location = /security.txt { - return 301 /.well-known/security.txt; - } - - location = /graphene.png { - return 301 /logo.png; - } - - location = /pdfviewer_privacy_policy { - return 301 /pdfviewer-privacy-policy; - } - - location = /safari_pinned_tab_icon.svg { - return 301 /mask-icon.svg; - } - - location = /safari-pinned-tab-icon.svg { - return 301 /mask-icon.svg; - } - - location = /bitcoin_address.png { - return 301 /bitcoin-donation.png; - } - - location = /bitcoin-address.png { - return 301 /bitcoin-donation.png; - } - - # mangled backlinks to /install - location = /installMinimal { - return 301 /install; - } - - location = /LICENSE { - default_type text/plain; - } - - location = /404 { - internal; - http2_push /grapheneos.css?20; - } - - location = /404.html { - internal; - http2_push /grapheneos.css?20; - } - - location ~ "^(.*)/index$" { - return 301 $1/; - } - - location ~ "\.(ico|webmanifest)$" { - include /etc/nginx/snippets/security-headers.conf; - add_header Cache-Control "public, max-age=604800"; - } - - location ~ "\.(css|js|svg)$" { - include /etc/nginx/snippets/security-headers.conf; - add_header Cache-Control "public, max-age=31536000"; - } - - location ~ "\.(png|woff2)$" { - include /etc/nginx/snippets/security-headers.conf; - add_header Cache-Control "public, max-age=31536000"; - gzip_static off; - } - - location ~ "\.(json|pdf|txt|xml)$" { - include /etc/nginx/snippets/security-headers.conf; - add_header Cache-Control "public, max-age=1800"; - } - - # https://www.twipu.com/GrapheneOS doesn't handle links with fragments properly - location ~ "^/(.*)