From 63e4542f31a02cf4825adf24d532df938faf4d1a Mon Sep 17 00:00:00 2001 From: Kimi Agent Date: Thu, 19 Mar 2026 03:22:23 -0400 Subject: [PATCH] fix: serve AlexanderWhitestone.com as static site (#416) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace auth-gated dashboard proxy with static file serving for The Wizard's Tower — two rooms (Workshop + Scrolls), no auth, no tracking, proper caching headers for 3D assets and RSS feed. Fixes #211 Co-authored-by: kimi Reviewed-on: http://localhost:3000/rockachopa/Timmy-time-dashboard/pulls/416 Co-authored-by: Kimi Agent Co-committed-by: Kimi Agent --- nginx-paperclip.conf | 97 +++++++++++++++++++++++++++++--------------- 1 file changed, 65 insertions(+), 32 deletions(-) diff --git a/nginx-paperclip.conf b/nginx-paperclip.conf index 94ceaaf4..6cbfcbc6 100644 --- a/nginx-paperclip.conf +++ b/nginx-paperclip.conf @@ -1,42 +1,75 @@ +# ── AlexanderWhitestone.com — The Wizard's Tower ──────────────────────────── +# +# Two rooms. No hallways. No feature creep. +# /world/ — The Workshop (3D scene, Three.js) +# /blog/ — The Scrolls (static posts, RSS feed) +# +# Static-first. No tracking. No analytics. No cookie banner. +# Site root: /var/www/alexanderwhitestone.com + server { listen 80; - server_name alexanderwhitestone.com 45.55.221.244; + server_name alexanderwhitestone.com www.alexanderwhitestone.com; - # Cookie-based auth gate — login once, cookie lasts 7 days - location = /_auth { - internal; - proxy_pass http://127.0.0.1:9876; - proxy_pass_request_body off; - proxy_set_header Content-Length ""; - proxy_set_header X-Original-URI $request_uri; - proxy_set_header Cookie $http_cookie; - proxy_set_header Authorization $http_authorization; + root /var/www/alexanderwhitestone.com; + index index.html; + + # ── Security headers ──────────────────────────────────────────────────── + add_header X-Content-Type-Options nosniff always; + add_header X-Frame-Options SAMEORIGIN always; + add_header Referrer-Policy strict-origin-when-cross-origin always; + add_header X-XSS-Protection "1; mode=block" always; + + # ── Gzip for text assets ──────────────────────────────────────────────── + gzip on; + gzip_types text/plain text/css text/xml text/javascript + application/javascript application/json application/xml + application/rss+xml application/atom+xml; + gzip_min_length 256; + + # ── The Workshop — 3D world assets ────────────────────────────────────── + location /world/ { + try_files $uri $uri/ /world/index.html; + + # Cache 3D assets aggressively (models, textures) + location ~* \.(glb|gltf|bin|png|jpg|webp|hdr)$ { + expires 30d; + add_header Cache-Control "public, immutable"; + } + + # Cache JS with revalidation (for Three.js updates) + location ~* \.js$ { + expires 7d; + add_header Cache-Control "public, must-revalidate"; + } } + # ── The Scrolls — blog posts and RSS ──────────────────────────────────── + location /blog/ { + try_files $uri $uri/ =404; + } + + # RSS/Atom feed — correct content type + location ~* \.(rss|atom|xml)$ { + types { } + default_type application/rss+xml; + expires 1h; + } + + # ── Static assets (fonts, favicon) ────────────────────────────────────── + location /static/ { + expires 30d; + add_header Cache-Control "public, immutable"; + } + + # ── Entry hall ────────────────────────────────────────────────────────── location / { - auth_request /_auth; - # Forward the Set-Cookie from auth gate to the client - auth_request_set $auth_cookie $upstream_http_set_cookie; - add_header Set-Cookie $auth_cookie; - - proxy_pass http://127.0.0.1:3100; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'upgrade'; - proxy_set_header Host localhost; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Host $host; - proxy_cache_bypass $http_upgrade; - proxy_read_timeout 86400; + try_files $uri $uri/ =404; } - # Return 401 with WWW-Authenticate when auth fails - error_page 401 = @login; - location @login { - proxy_pass http://127.0.0.1:9876; - proxy_set_header Authorization $http_authorization; - proxy_set_header Cookie $http_cookie; + # Block dotfiles + location ~ /\. { + deny all; + return 404; } }