Files
deepstock/nginx.conf
Dorian 425e56c0ca feat: SEO crawlability + on-brand copy
Make every served byte crawlable without executing JS, remove off-brand
copy, and cut third-party requests.

- Copy: replace off-brand terms (survival/crisis/collapse) in title, meta,
  OG/Twitter, JSON-LD and webmanifest with on-brand preparedness copy.
  Update App.vue i18n page_title/meta_description (EN+DE) too, since the app
  overwrites the head at runtime. Reconcile area count to the real 6.
- Prerender: vite-plugin-seo-snapshot injects a static <noscript> snapshot
  (real <h1>, content, <a href>) after #app. JS users ignore <noscript>, so
  the live app/UX is unchanged; curl/no-JS crawlers get real content.
- 404: nginx now returns true 404s on unknown paths (no soft-200 SPA
  fallback) with a branded 404 page.
- Sitemap: drop no-op hreflang alternates, add <lastmod>.
- Fonts: self-host Space Mono / DM Serif Display / Barlow (woff2, latin +
  latin-ext, font-display: swap); preload above-the-fold faces. No more
  fonts.googleapis/gstatic requests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 08:20:19 +01:00

60 lines
1.7 KiB
Nginx Configuration File

server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Permissions-Policy "geolocation=(), microphone=(), camera=()" always;
# Hashed asset bundles — long cache, immutable
location /assets/ {
expires 1y;
add_header Cache-Control "public, immutable";
try_files $uri =404;
}
# Public images and other static files
location ~* \.(?:jpg|jpeg|png|gif|webp|svg|ico|woff2?|ttf)$ {
expires 30d;
add_header Cache-Control "public";
try_files $uri =404;
}
# App shell — only the root path serves index.html. The app is a
# single-route SPA (no history-based client routing), so there is no
# need to fall back unknown paths to index.html.
location = / {
try_files /index.html =404;
}
# Everything else serves a real file if it exists, otherwise a true 404.
# This avoids the soft-404 (HTTP 200 on unknown paths) that hurts SEO.
# When real redirects/removals appear, add `return 301`/`return 410`
# location blocks above this one.
location / {
try_files $uri $uri/ =404;
}
# Branded 404 page (shipped from public/404.html).
error_page 404 /404.html;
location = /404.html {
internal;
}
# Don't serve dotfiles
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
}