Skip to content

refactor(nginx): proxy to named upstreams defined in one file - #26175

Merged
antobinary merged 1 commit into
bigbluebutton:v4.1.x-developfrom
tibroc:simplify/nginx-upstreams
Oct 23, 2026
Merged

antobinary merged 1 commit into
bigbluebutton:v4.1.x-developfrom
tibroc:simplify/nginx-upstreams

Conversation

@tibroc

@tibroc tibroc commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

The nginx location files now proxy to named upstreams defined in one file, instead of literal 127.0.0.1/localhost addresses, so the backend addresses can be changed in one place.

Change

  • The locations of bbb-web, graphql-middleware, livekit, webrtc-sfu, shared-notes and webhooks proxy_pass to six upstreams: bbb-web, bbb-graphql-middleware, bbb-livekit, bbb-webrtc-sfu, bbb-shared-notes-server, bbb-webhooks.
  • bbb-config installs them in /etc/nginx/conf.d/bbb-upstreams.conf, with exactly today's addresses.
  • The Hasura balancer keeps its own upstream hasura, so locally edited copies of that conffile still load.

Package installs

  • Backends get the same ports, URIs and auth subrequests. Only the internal Host header changes where a location does not set it (bbb-web instead of 127.0.0.1:8090; same for LiveKit and the SFU); I found no Host use in bbb-web, LiveKit v1.9.12 or bbb-webrtc-sfu.
  • The new location files need bbb-config of the same release, which the bigbluebutton meta package pins; installing one new package against an old bbb-config makes the nginx reload fail (see details).

Tested

  • nginx -T before and after differs only in the new file and the proxy_pass targets.
  • Requests through the site against echo backends gave the same status codes, ports, URIs and auth subrequests.
  • A redirect probe with the embedded Tomcat 10.1.59 that bbb-web uses showed the Host behaviour described in the details.

Question

  • Is the changed internal Host header acceptable?
  • Do you prefer one file in bbb-config, or one upstream file per package?

Image follow-up: v4.1.x-develop...tibroc:bigbluebutton:images/nginx-upstreams, which removes the start script that rewrites the proxy_pass addresses (or mounted copies of each location file). Images: #26141.

Details
  • Host header: the webhooks location sets Host $http_host, so its Host header does not change. nginx sends Host: bbb-web; Tomcat then reports port 80, and absolute redirects become http://bbb-web/..., which proxy_redirect default still maps.
  • Upgrades: bbb-webhooks is not in the meta package, so it relies on being upgraded together with it. The risk is narrow: it needs an admin to install one new package (for example bbb-livekit) against an old bbb-config, and then nginx fails its reload. If that is a concern, each of the six packages can ship its own conf.d upstream file next to its location file instead.

The location files of bbb-web, graphql-middleware, livekit, webrtc-sfu,
shared-notes and webhooks proxy to literal 127.0.0.1/localhost addresses.
They now proxy to named upstreams, and bbb-config installs the addresses in
one file, /etc/nginx/conf.d/bbb-upstreams.conf, with the same addresses as
before. Moving a service to another host changes one line there instead of a
copy of the location file.
@coderabbitai

coderabbitai Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 4
  • v3.0.x-release
  • v3.0.x-develop
  • v4.0.x-release
  • v4.0.x-develop

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bf8772a6-8da3-413c-9627-54b9442f54a6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

🚨 Automated tests failed

@imdt-claudiop

Copy link
Copy Markdown
Contributor

Went looking for behavior changes and found none that bite. All six upstreams keep the exact address and port of the old proxy_pass values (including localhost for shared-notes, which resolves at config load the same way it did inline); upstream blocks land in /etc/nginx/conf.d (http context), which the distro nginx.conf includes, and there is no name collision with the existing upstream hasura of the Hasura balancer. The Host header seen by backends changes from 127.0.0.1:<port> to the upstream name on locations that do not pin Host, but none of those backends uses Host to build URLs or validate requests: bbb-web derives every outward URL from serverURL, webhooks pins $http_host, /graphql and /hocuspocus/sample pin $host, and the LiveKit signal path and the SFU websocket do not validate Host. proxy_redirect default stays self-consistent since container-generated redirects are built from the same Host the proxy sends. Single-server upstreams keep nginx's "never marked unavailable" rule, so retry semantics are unchanged. LGTM.

@tibroc

tibroc commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for the thorough check of the Host header and redirect paths.

@antobinary antobinary added this to the Release 4.1 milestone Oct 23, 2026
@antobinary
antobinary merged commit a8c015d into bigbluebutton:v4.1.x-develop Oct 23, 2026
48 of 51 checks passed
antobinary added a commit to antobinary/bigbluebutton that referenced this pull request Oct 23, 2026
…evelop

Brings in v4.1.x-develop at a8c015d: the nginx named upstreams (bigbluebutton#26175)
and the environment overrides for bbb-web, akka-apps, graphql-middleware,
shared-notes and export-annotations.

Conflicts:
- bigbluebutton-web/bbb-web.nginx: 4.0 removed the handler-less
  validatePad location (84feef4); 4.1 switched its proxy_pass to the
  bbb-web upstream. The location stays removed; every other location uses
  the upstream.
- bbb-export-annotations/shapes/Shape.js: 4.0 measures text with HarfBuzz
  (c2f9fae); 4.1 reads the settings through lib/utils/config.js so the
  override file applies (60faa68). Both are kept, and the font lookup
  uses the shared config instead of reading config/settings.json itself.
antobinary added a commit that referenced this pull request Oct 30, 2026
build(docker): use the new config options of #26170-#26175 in the images
antobinary pushed a commit that referenced this pull request Nov 12, 2026
Since #26175 the nginx locations proxy to named upstreams, and the
addresses live in /etc/nginx/conf.d/bbb-upstreams.conf. Three checks
still looked for the port in the location files:

- --check compared the webhooks port with a sed on webhooks.nginx that
  expects host:port. On "proxy_pass http://bbb-webhooks;" it matches
  nothing, so it printed "Webhooks port mismatch" on every server with
  bbb-webhooks.
- The development check grepped web.nginx for 8090, which is no longer
  there, so it always warned that nginx is not serving bbb-web from
  port 8090.
- The check for a developer's own bbb-web grepped web.nginx for 8888,
  so it never ran.

get_upstream_port reads the port of a named upstream from
bbb-upstreams.conf, and the three checks use it.
@tibroc
tibroc deleted the simplify/nginx-upstreams branch November 26, 2026 10:25
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.

3 participants