summaryrefslogtreecommitdiff
path: root/deploy/nginx-yesod.conf
diff options
context:
space:
mode:
authorskylar <me@casper>2026-11-01 05:43:24 -0800
committerskylar <me@casper>2026-11-01 05:43:24 -0800
commite69ad01e700e80fa959dfee08cd556ca0d777ffd (patch)
tree645fc9db2142e87a5ef302733a77ba2fec848d88 /deploy/nginx-yesod.conf
Yesod: self-hosted WebXR rooms
Start a room in a world and hang out in VR from the headset's browser: A-Frame + Networked-A-Frame over EasyRTC, with a coturn relay that can hide everyone's IP address. Ships with the Campfire, Temple, Cabin, Balcony and Test room worlds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'deploy/nginx-yesod.conf')
-rw-r--r--deploy/nginx-yesod.conf41
1 files changed, 41 insertions, 0 deletions
diff --git a/deploy/nginx-yesod.conf b/deploy/nginx-yesod.conf
new file mode 100644
index 0000000..dc9404b
--- /dev/null
+++ b/deploy/nginx-yesod.conf
@@ -0,0 +1,41 @@
+# Yesod at https://example.org/vr/ (any path works: the app only uses
+# relative URLs). Include this from your site's TLS server block; it proxies to
+# the Node app on PORT (8095 by default).
+#
+# Nothing about visitors is logged here: no access log (who loaded the page,
+# when, from where), and only critical errors, which don't name visitors.
+location = /vr {
+ access_log off;
+ error_log /dev/null crit;
+ return 301 /vr/;
+}
+
+location /vr/ {
+ access_log off;
+ error_log /dev/null crit;
+
+ proxy_pass http://127.0.0.1:8095/;
+ proxy_http_version 1.1;
+
+ # socket.io upgrades to a WebSocket for signaling.
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection $http_connection;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+
+ proxy_read_timeout 1h;
+ proxy_send_timeout 1h;
+ client_max_body_size 16k;
+
+ # Compress scripts, JSON and 3D models (.glb, and .vrm which is served as
+ # octet-stream): the libraries shrink ~75%, avatars and hands 50-85%.
+ # Images are already compressed and left alone.
+ gzip on;
+ gzip_proxied any;
+ gzip_vary on;
+ gzip_comp_level 5;
+ gzip_min_length 1024;
+ gzip_types application/javascript text/css application/json model/gltf-binary application/octet-stream;
+}