English
Deploy in production
The simplest and safest way to run ReliaForge in production is a single container serving both the backend API and the built console on one origin, behind a reverse proxy that authenticates operators.
Option 1: Single-process container (recommended)
Build the frontend once and point RELIAFORGE_CONSOLE_DIR at the dist/ directory:
bash
npm ci && npm run build
RELIAFORGE_CONSOLE_DIR=/srv/reliaforge/console reliaforgeOne container then serves SPA routes, /api/v1 endpoints, plugin UI bundles, SSE log streams, and WebSocket terminals on the same origin, avoiding CORS headaches. See deploy/Dockerfile in reliaforge-plugins for a ready-to-build multi-stage image.
Option 2: Separate static web server
If you prefer serving dist/ from Nginx or Caddy separately:
- Return
index.htmlfor unknown client-side routes (SPA fallback). - Proxy
/api/v1to the backend on the same origin. - Disable proxy response buffering on SSE log routes (
X-Accel-Buffering: no/proxy_buffering off) and forwardUpgrade+Connectionheaders for WebSocket terminals.
Never place upstream API tokens or proxy secrets in VITE_* build variables; they are compiled into public browser bundles.
Reverse proxy authentication checklist
When RELIAFORGE_AUTH_MODE=proxy is set:
- Restrict
RELIAFORGE_TRUSTED_PROXIESto the exact CIDR of your reverse proxy or ingress gateway. - Inject the authenticated operator header (default
X-ReliaForge-User) and the shared secret header (X-ReliaForge-Proxy-Secret) at the proxy layer, stripping any client-supplied copies first. - Ensure the proxy preserves its direct TCP peer address to the backend and forwards WebSocket upgrade requests with the same auth headers.
- Set
RELIAFORGE_TRUSTED_ORIGINSonly if browsers connect from an origin other than the backend's own host.
If any required production auth setting is missing, reliaforge refuses to start.
Read-only demo build
bash
npm run build:demoGenerates the static hash-routed bundle published at demo.reliaforge.dev. It runs entirely on preset JSON fixtures with no backend or write actions. For frontend development commands, see reliaforge-frontend.
Review the security model before exposing an instance outside a private network.
