Leon4gr45/builder
0
1# Self-Hosted Domain Routing2 3Guide for OSW Studio operators running their own instances.4 5## Deployment Serving6 7Published deployments are served by Node.js route handlers by default. For better performance, set `STATIC_PROXY=true` in `.env` and use a reverse proxy (e.g., Caddy) to serve deployment files directly. With this setup, deployment requests bypass Node.js entirely.8 9When `STATIC_PROXY=true`, publishing or deleting a deployment with a custom domain automatically regenerates the proxy config and reloads it.10 11## Custom Domains12 13Users can set a custom domain in Deployment Settings and publish. The instance exposes a domain resolution API for proxy integration:14 15```16GET /api/resolve-domain?host=sweetcandies.com → { deploymentId, path }17GET /api/resolve-domain?domain=sweetcandies.com → 200 or 404 (for on-demand TLS verification)18GET /api/resolve-domain?list=true → { domains: [...] } (all registered domains)19```20 21### User Setup22 231. Enter their domain in Deployment Settings242. Publish the deployment253. Add a DNS A record pointing to your server's IP264. Wait for DNS propagation and SSL provisioning27 28### Notes29 30- Deployments published with a custom domain use root-relative asset paths. The direct URL at `/deployments/{id}/` will have broken assets — access via the custom domain instead.31- The domain is registered in the routing table on publish. If a domain is removed and republished, the routing entry is cleared.32 