Nginx Reverse Proxy
web
Migration in progress. api.legendary-arena.com and PostgreSQL are moving from Render to a self-hosted DigitalOcean Ubuntu host behind Cloudflare. Render remains rollback-ready until decommission phase.
Nginx Reverse Proxy
Install Nginx and proxy api traffic to the local Node server with WebSocket-safe headers.
Summary
This page owns:
The script installs Nginx, places the site config, validates syntax, enables the site, and reloads Nginx.
Execute
Run as root:
sudo pwsh -File infra/scripts/20-nginx.ps1
Optional overrides:
sudo DOMAIN=api.legendary-arena.com UPSTREAM_PORT=3000 pwsh -File infra/scripts/20-nginx.ps1
Verify
sudo nginx -t
sudo systemctl status nginx --no-pager
curl -I http://127.0.0.1/health
Expected:
- nginx config test succeeds
- service is active
- health endpoint returns from upstream app
Why WebSocket headers matter
The server uses Socket.IO over upgraded connections. Missing Upgrade and Connection headers can cause gameplay session failures even when basic HTTP looks healthy.
References
- Plan section 4.3 nginx-reverse-proxy page stub
- Plan section 5.1 runtime and web base checklist