Files
SideImpactor/nginx.conf
Lakr aef3c71ed4 fix: show 2FA errors in modal, fix stale device check, add dark mode
- Keep TwoFactorModal open after code submit; display server-side
  errors inline instead of silently closing the modal
- handlePair now returns PairedDeviceInfo so handleInstall uses the
  fresh UDID instead of stale closure state
- Add explicit /wisp/ location in nginx.conf returning 502 to prevent
  SPA fallback from swallowing websocket upgrades
- Add prefers-color-scheme dark mode via CSS custom property overrides;
  replace hardcoded rgba/hex with color-mix() for automatic adaptation
2026-04-13 17:18:07 +08:00

58 lines
1.6 KiB
Nginx Configuration File

server {
listen 3000;
server_name _;
root /usr/share/nginx/html;
index index.html;
# MIME for WASM streaming compile.
types {
application/wasm wasm;
}
# Security headers.
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
# WebAssembly + crypto.subtle require secure-context; cross-origin isolation
# is needed for SharedArrayBuffer used by the signing WASM bundles.
add_header Cross-Origin-Opener-Policy "same-origin" always;
add_header Cross-Origin-Embedder-Policy "require-corp" always;
# Compression.
gzip on;
gzip_vary on;
gzip_min_length 256;
gzip_types
application/javascript
application/json
application/wasm
application/xml
text/css
text/javascript
text/plain
image/svg+xml;
# Hashed assets (Vite emits /assets/* with content hashes) — cache forever.
location /assets/ {
add_header Cache-Control "public, max-age=31536000, immutable" always;
try_files $uri =404;
}
# Never cache the shell HTML.
location = /index.html {
add_header Cache-Control "no-cache" always;
}
# WISP websocket — must be proxied by an outer reverse proxy or sidecar.
# Return 502 so the frontend gets a clear signal rather than the SPA shell.
location /wisp/ {
return 502;
}
# Hash routing (no server-side routes needed) — fall back to index.html.
location / {
try_files $uri $uri/ /index.html;
}
}