Single HTTPS APP_URL origin and /ws collaboration proxy

#07Cloud or Self-Hosted Deployment with Full Data Sovereignty
Organization policies, single-origin HTTPS Self-Host deployment, encrypted backups, and offline nodo.lic licensing.
In this article

Configure one canonical HTTPS APP_URL and matching CORS_ORIGIN

Production Nodo Self-Host runs on a single HTTPS origin so browser sessions, API requests, and real-time sockets share one strict trust boundary:

  • Set APP_URL to your exact external URL (for example https://nodo.company.internal) with no trailing slash
  • Set CORS_ORIGIN to the exact same origin; never use wildcard * in production
  • Serve the SPA, REST/tRPC API, property WebSocket, and /ws document collaboration under that same hostname
  • Keep authentication cookies host-only with httpOnly, secure, and sameSite=lax enabled

Mismatched origins or mixed HTTP/HTTPS redirects cause session cookies to drop and trigger CSRF rejections.

Configure one canonical HTTPS APP_URL and matching CORS_ORIGIN
Configure one canonical HTTPS APP_URL and matching CORS_ORIGIN

Proxy /ws WebSocket upgrades cleanly through Traefik and Nginx

Real-time collaborative editing relies on long-lived WebSocket connections routed to the Hocuspocus sidecar at wss://<app-host>/ws:

  • Forward Upgrade and Connection: upgrade headers together with Host, X-Forwarded-For, and X-Forwarded-Proto: https
  • Configure proxy read and write timeouts generously (at least 60–300 seconds) so idle editing tabs do not disconnect repeatedly
  • Keep Traefik v3 configured via a read-only File Provider directory rather than mounting /var/run/docker.sock
  • Verify that intermediate corporate firewalls or WAF appliances allow WebSocket upgrades on port 443

If /ws fails to upgrade, pages may still load over HTTPS while real-time collaboration shows reconnecting.

Manage TLS certificates and reverse-proxy validation

Valid, automatically renewed TLS certificates are required for WebAuthn Passkeys, secure cookies, and browser trust:

  • Use automated ACME (Let’s Encrypt) for public hosts or your internal enterprise PKI with full intermediate chains for private networks
  • Enforce HTTP-to-HTTPS 301 redirection and enable HSTS once HTTPS is verified end to end
  • Keep operator or database admin interfaces internal-only over WireGuard rather than exposing a public admin hostname
  • Test both HTTPS API calls and a live wss://<app-host>/ws handshake after every proxy or certificate renewal

Check proxy error logs immediately if browsers report certificate chain warnings or 502 Bad Gateway responses.

Related articles