load_module modules/ngx_http_brotli_static_module.so; user nginx; worker_processes auto; worker_rlimit_nofile 8192; pid /run/nginx.pid; events { worker_connections 4096; } http { include mime.types; default_type application/octet-stream; charset utf-8; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 4096; server_tokens off; client_max_body_size 1k; client_body_buffer_size 1k; client_header_buffer_size 1k; large_client_header_buffers 4 4k; http2_max_field_size 4k; http2_max_header_size 16k; http2_recv_buffer_size 128k; client_body_timeout 30s; client_header_timeout 30s; send_timeout 30s; http2_recv_timeout 30s; http2_max_concurrent_streams 32; limit_conn_zone $binary_remote_addr zone=addr:10m; limit_conn addr 256; ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256; ssl_prefer_server_ciphers on; ssl_certificate /etc/letsencrypt/live/grapheneos.org/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/grapheneos.org/privkey.pem; ssl_session_cache shared:SSL:10m; ssl_session_timeout 1d; ssl_session_tickets off; ssl_buffer_size 4k; ssl_trusted_certificate /etc/letsencrypt/live/grapheneos.org/chain.pem; ssl_stapling on; ssl_stapling_verify on; # maintained by certbot-ocsp-fetcher ssl_stapling_file /etc/nginx/ocsp-cache/grapheneos.org.der; access_log /var/log/nginx/access.log combined buffer=64k flush=1m; error_log /var/log/nginx/error.log; gzip_proxied any; gzip_vary on; if_modified_since before; map $http_cookie $preload_resources { "~*__Host-preload=1" ""; default "; rel=preload; as=style, ; rel=preload; as=font; crossorigin, ; rel=preload; as=font; crossorigin, ; rel=preload; as=image"; } server { listen 80 backlog=4096; listen [::]:80 backlog=4096; server_name grapheneos.org www.grapheneos.org grapheneos.app www.grapheneos.app grapheneos.com www.grapheneos.com grapheneos.info www.grapheneos.info grapheneos.page www.grapheneos.page vanadium.app www.vanadium.app; root /var/empty; return 301 https://$host$request_uri; } server { listen 443 ssl http2 backlog=4096; listen [::]:443 ssl http2 backlog=4096; server_name www.grapheneos.org grapheneos.app www.grapheneos.app grapheneos.com www.grapheneos.com grapheneos.info www.grapheneos.info grapheneos.page www.grapheneos.page; root /var/empty; include snippets/security-headers.conf; return 301 https://grapheneos.org$request_uri; } server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name vanadium.app www.vanadium.app; root /var/empty; include snippets/security-headers.conf; return 302 https://github.com/GrapheneOS/Vanadium; } server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name grapheneos.org; root /var/www/html; error_page 403 =404 /404.html; error_page 404 /404.html; include snippets/security-headers.conf; gzip_static on; brotli_static on; if ($request_uri ~ ^/(.*)\.html$) { return 301 /$1; } if ($request_uri ~ (.*)//(.*)) { return 301 $1/$2; } if ($request_uri ~ ^(.*)/index$) { return 301 $1/; } # https://www.twipu.com/GrapheneOS doesn't handle links with fragments properly if ($request_uri ~ "^/(.*)