Skip to content

fix: add livekit_server_container_http_host_bind_port for nginx-on-ho…#4961

Open
AlexanderBrolin wants to merge 6 commits intospantaleev:masterfrom
AlexanderBrolin:claude/fix-matrix-group-calls-MvHSU
Open

fix: add livekit_server_container_http_host_bind_port for nginx-on-ho…#4961
AlexanderBrolin wants to merge 6 commits intospantaleev:masterfrom
AlexanderBrolin:claude/fix-matrix-group-calls-MvHSU

Conversation

@AlexanderBrolin
Copy link

…st setups

The upstream galaxy/livekit_server role never publishes port 7880 (HTTP signaling) to the host — it assumes a Traefik container on the same Docker network. This breaks setups where nginx runs on a separate host and proxies to the Matrix server over LAN.

Changes:

  • Fork galaxy/livekit_server → roles/custom/livekit_server/ so the patch survives make roles (which wipes roles/galaxy/)
  • Add livekit_server_container_http_host_bind_port variable (defaults to "") in defaults/main.yml; when set, publishes the HTTP port via -p flag
  • Add {% if livekit_server_container_http_host_bind_port %} block in the systemd service template to conditionally map the port
  • Guard network-creation tasks with and livekit_server_container_network != 'host' to prevent 403 errors when network: host is configured
  • Update setup.yml: galaxy/livekit_server → custom/livekit_server

Usage in vars.yml:
livekit_server_container_http_host_bind_port: '192.168.90.83:7880'

https://claude.ai/code/session_01SbRgWsRDKpTZ2TTbWDhtEB

…st setups

The upstream galaxy/livekit_server role never publishes port 7880 (HTTP
signaling) to the host — it assumes a Traefik container on the same Docker
network. This breaks setups where nginx runs on a separate host and proxies
to the Matrix server over LAN.

Changes:
- Fork galaxy/livekit_server → roles/custom/livekit_server/ so the patch
  survives `make roles` (which wipes roles/galaxy/)
- Add livekit_server_container_http_host_bind_port variable (defaults to "")
  in defaults/main.yml; when set, publishes the HTTP port via -p flag
- Add {% if livekit_server_container_http_host_bind_port %} block in the
  systemd service template to conditionally map the port
- Guard network-creation tasks with `and livekit_server_container_network != 'host'`
  to prevent 403 errors when network: host is configured
- Update setup.yml: galaxy/livekit_server → custom/livekit_server

Usage in vars.yml:
  livekit_server_container_http_host_bind_port: '192.168.90.83:7880'

https://claude.ai/code/session_01SbRgWsRDKpTZ2TTbWDhtEB
@AlexanderBrolin
Copy link
Author

1

AlexanderBrolin and others added 5 commits February 24, 2026 13:17
- Revert setup.yml to use galaxy/livekit_server (avoids loading all
  uninstalled galaxy roles when running with --tags)
- Add livekit.yml: minimal standalone playbook that only includes
  galaxy/systemd_docker_base and custom/livekit_server, so livekit
  setup can run independently without requiring all other galaxy roles

Usage:
  ansible-playbook -i inventory/hosts livekit.yml \
    --tags=setup-livekit-server,start-group-services

https://claude.ai/code/session_01SbRgWsRDKpTZ2TTbWDhtEB
matrix_user_uid/gid, matrix_server_fqn_matrix, matrix_addons_container_network
are all defined by custom/matrix-base and required by livekit_server role.

https://claude.ai/code/session_01SbRgWsRDKpTZ2TTbWDhtEB
devture_playbook_help_container_retries_count/delay are defined by
galaxy/playbook_help and required by install.yml image pull tasks.

https://claude.ai/code/session_01SbRgWsRDKpTZ2TTbWDhtEB
When using an external nginx (e.g. on a separate host) to reverse-proxy
the LiveKit JWT Service at a path prefix, the nginx location block MUST
include a trailing slash.

Without it: `location ^~ /livekit-jwt-service` + `proxy_pass .../;`
replaces `/livekit-jwt-service` with `/`, producing `//get_token`
(double slash). Go's net/http issues a 301 redirect to normalize the
path. Element Call follows the redirect to the wrong URL, fails to get a
JWT token, and the call establishes at the Matrix signaling level but
without any audio or video.

With trailing slash: `location ^~ /livekit-jwt-service/` replaces the
prefix correctly, producing `/get_token` with a single slash.

The same trailing-slash rule applies to the livekit-server location
block to avoid path issues for any sub-paths.

The built-in Traefik setup is unaffected (uses stripprefix middleware).

https://claude.ai/code/session_01SbRgWsRDKpTZ2TTbWDhtEB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants