Repository navigation
refactor(nginx): proxy to named upstreams defined in one file - #26175
Conversation
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.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review: 4
Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
🚨 Automated tests failed |
|
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 |
|
Thanks for the thorough check of the Host header and redirect paths. |
a8c015d
into
bigbluebutton:v4.1.x-develop
…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.
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.
The nginx location files now proxy to named upstreams defined in one file, instead of literal
127.0.0.1/localhostaddresses, so the backend addresses can be changed in one place.Change
proxy_passto six upstreams:bbb-web,bbb-graphql-middleware,bbb-livekit,bbb-webrtc-sfu,bbb-shared-notes-server,bbb-webhooks./etc/nginx/conf.d/bbb-upstreams.conf, with exactly today's addresses.upstream hasura, so locally edited copies of that conffile still load.Package installs
Hostheader changes where a location does not set it (bbb-webinstead of127.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.bigbluebuttonmeta package pins; installing one new package against an old bbb-config makes the nginx reload fail (see details).Tested
nginx -Tbefore and after differs only in the new file and theproxy_passtargets.Question
Hostheader acceptable?Image follow-up: v4.1.x-develop...tibroc:bigbluebutton:images/nginx-upstreams, which removes the start script that rewrites the
proxy_passaddresses (or mounted copies of each location file). Images: #26141.Details
Host $http_host, so its Host header does not change. nginx sendsHost: bbb-web; Tomcat then reports port 80, and absolute redirects becomehttp://bbb-web/..., whichproxy_redirect defaultstill maps.conf.dupstream file next to its location file instead.