mirror of
https://github.com/gadgethd/ukmesh.git
synced 2026-09-16 20:12:35 +00:00
Splits the monolithic app container into: - backend: Node.js handling MQTT, WebSocket, API, DB (no static files) - app: Nginx serving the React SPA, proxying /api and /ws to backend This means future dashboards (app.ukmesh.com etc.) can be added as additional Nginx containers pointing at the same backend with no duplicate calculations or DB connections. Also updates nginx.website.conf to proxy to backend instead of app, and bumps website host port from 3001 to 3002 to avoid conflict. NOTE: Cloudflare Zero Trust tunnel route for app.teessidemesh.com must be updated from http://app:3000 to http://app:80. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
19 lines
456 B
Plaintext
19 lines
456 B
Plaintext
server {
|
|
listen 80;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# Proxy API calls through to the app service so live stats work
|
|
location /api/ {
|
|
proxy_pass http://backend:3000/api/;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
}
|
|
|
|
# SPA fallback — all routes serve index.html
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|