diff --git a/docs/gotchas.md b/docs/gotchas.md index b5bf6782..a3b131c8 100644 --- a/docs/gotchas.md +++ b/docs/gotchas.md @@ -12,8 +12,8 @@ touching. The CLI doesn't accept `--bind`. Path is via `EXTRA_NSPAWN_FLAGS` in `/etc/nixos-containers/.conf` — the start script (`/nix/store/.../container_-start`) expands it unquoted into the -`systemd-nspawn` invocation. `lifecycle::set_nspawn_flags()` rewrites -this line. +`systemd-nspawn` invocation. `lifecycle::host_config::set_nspawn_flags()` +rewrites this line. ### `/run/systemd/nspawn/*.nspawn` overrides are ignored @@ -187,21 +187,22 @@ scripts, manual `rm -rf`), the dashboard's next render marks them ### SPA fallback: use `Accept` header map, not `try_files ... /index.html` -The naive nginx pattern for a path-prefix SPA (`try_files $uri $uri/ -/matrix/index.html`) silently swallows asset 404s — a missing JS file +The naive nginx pattern for an SPA (`try_files $uri $uri/ +/index.html`) silently swallows asset 404s — a missing JS file returns `index.html` with a 200, so the JS runtime never loads and the page renders blank with no visible error. Extension allowlists (tried as an alternative) have the same maintenance problem: any new file extension the SPA ships breaks silently. -The pattern that works (`hive-gateway.nix`) keys the fallback on the +The pattern that works (`nix/host-modules/hive-matrix.nix`, serving +fluffychat at the matrix gateway vhost's root) keys the fallback on the HTTP `Accept` header: ```nginx # Outside the server block (appendHttpConfig): map $http_accept $matrix_spa_target { default "/__matrix_spa_no_html_fallback"; - "~*text/html" "/matrix/index.html"; + "~*text/html" "/index.html"; } # Inside the location: