Files
Atharv1705 5703fbb27f feat: modernize UI/UX to 2026 US fintech standard, add violet AI accents, and strengthen security controls
- Modern 2026 US fintech visual redesign across User & Admin Dashboards, Marketing pages, Auth screens, and Layouts
- Introduced violet accent (#6D28D9 / #8B5CF6) strictly dedicated to AI capabilities (AI Daily Briefing, AI Assistant, Chatbot FAB & Chat UI)
- Motion system respecting prefers-reduced-motion and (hover: none) with GPU-accelerated transforms & opacities
- High-resolution dark glass monogram logo mark with upward growth motif
- Backend security enhancements: strict MIME-type sniffing validation, admin assignment scoping assertions, safe document deletion handling
- Nginx strict Content-Security-Policy (CSP) headers and favicon routing
2026-11-03 14:07:35 +05:30

112 lines
4.5 KiB
Plaintext

server {
# -- Real-IP: trust the Docker bridge so rate-limit keying uses the
# actual client IP, not the shared proxy/bridge address. ----------
set_real_ip_from 172.16.0.0/12; # Docker default bridge range
set_real_ip_from 10.0.0.0/8; # Common overlay networks
set_real_ip_from 127.0.0.1; # local loopback (dev)
real_ip_header X-Forwarded-For;
real_ip_recursive on;
listen 80;
server_name aicpa.duckdns.org 13.140.170.213;
# Security Headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com data:; img-src 'self' data: blob: https:; connect-src 'self' https:; object-src 'none'; base-uri 'self';" always;
# Redirect all HTTP traffic to HTTPS (uncomment when SSL certs are generated)
# location / {
# return 301 https://$host$request_uri;
# }
# Max upload size — matches backend 10MB limit with buffer
client_max_body_size 15m;
# ── Certbot ACME Challenge ───────────────────────────────────────────────
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
# ── Static CSS (served directly from dist, no FastAPI hop) ───────────────
location /css/ {
root /usr/share/nginx/html;
expires 7d;
add_header Cache-Control "public, no-transform";
try_files $uri =404;
}
# ── Vite JS/CSS bundle assets (hashed filenames — cache forever) ─────────
location /assets/ {
root /usr/share/nginx/html;
expires 1y;
add_header Cache-Control "public, immutable";
try_files $uri =404;
}
# ── Static images served from dist ───────────────────────────────────────
location /images/ {
root /usr/share/nginx/html;
expires 7d;
add_header Cache-Control "public, no-transform";
try_files $uri =404;
}
# ── Favicon and root-level static files ──────────────────────────────────
location = /favicon.svg {
root /usr/share/nginx/html;
expires 7d;
}
location = /favicon.png {
root /usr/share/nginx/html;
expires 7d;
}
location = /icons.svg {
root /usr/share/nginx/html;
expires 7d;
}
# ── User-uploaded files (documents stored on VPS disk) ───────────────────
# Proxied through FastAPI for auth token validation — never served directly
location /api/upload/file/ {
proxy_pass http://app:8000;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
# Allow larger responses for file downloads
proxy_buffering off;
proxy_read_timeout 120s;
}
# ── All API routes → FastAPI ──────────────────────────────────────────────
location /api/ {
proxy_pass http://app:8000;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 60s;
proxy_send_timeout 60s;
}
# ── Health check (bypass FastAPI for load balancer pings) ────────────────
location = /health {
proxy_pass http://app:8000;
proxy_set_header Host $host;
}
# ── SPA fallback — serve index.html for all other routes ─────────────────
# React Router handles the actual routing client-side
location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}
}