# nginx: serve the built Vue SPA + reverse-proxy /api to the Flask backend. server { listen 80; server_name _; root /app/frontend/dist; index index.html; # SPA fallback: any non-API GET that isn't a real file -> index.html location / { try_files $uri $uri/ /index.html; } # API traffic goes to the Flask backend on 127.0.0.1:5000 location /api/ { proxy_pass http://127.0.0.1:5000; proxy_set_header Host $host; 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_read_timeout 120s; } # never serve dotfiles location ~ /\. { deny all; } gzip on; gzip_types text/css application/javascript application/json; }