operations

๐Ÿ” Viewer Proxy

Viewer camera mode, nginx proxying, TLS/basic auth, iframe safety, and same-origin rules.

The Prismarine viewer is a local WebGL service. Public exposure needs an operator boundary.

Camera mode#

Camera mode is chosen by the viewer process, not by a browser query string.

Variable Meaning
VIEWER_FIRST_PERSON=false Third-person/default camera.
VIEWER_FIRST_PERSON=true First-person camera.

Changing camera mode requires updating environment and reloading the viewer process.

Reverse-proxy posture#

  • keep the viewer bound to localhost when possible;
  • put TLS and authentication on the public hostname;
  • proxy /viewer/ through nginx with WebSocket upgrade headers;
  • use a dedicated auth file or stronger auth in front of public access.

Same-origin rule#

The dashboard prefers the /viewer/ proxy so HTTPS dashboards do not embed insecure HTTP viewer iframes. Per-agent direct viewer ports need the same protection if the dashboard is served over HTTPS.

Viewer config reminders#

Key variables: PORT, VIEWER_USERNAME, VIEWER_VIEW_DISTANCE, VIEWER_FIRST_PERSON, VIEWER_RENDER_VERSION, VIEWER_VERSION_FALLBACK, and reconnect timing variables.

Sources: wiki/content/docs/viewer-proxy.md, wiki/content/docs/viewer.md, moincraft/docs/security-hardening.md.