nginxInfo: report dashName alongside ffmpegFlags - #84
Conversation
The manifest is written to ${DASH_NAME}.mpd, which is configurable and
need not match the publish name, so a client cannot reliably guess the
URL it should request. /nginxInfo already exists to tell a client how
this server is configured; it just never reported this part.
One field, both config variants kept identical.
There was a problem hiding this comment.
Pull request overview
This PR extends the /nginxInfo endpoint so clients can discover the configured DASH manifest base name (dashName) alongside the existing ffmpegFlags, enabling clients to reliably construct the correct ${DASH_NAME}.mpd URL.
Changes:
- Add
"dashName":"${DASH_NAME}"to the JSON returned by/nginxInfoin the SSL nginx config. - Mirror the same
/nginxInfochange in the non-SSL nginx config to keep the two configurations aligned.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| nginx-transcoder/nginx.conf | Extends /nginxInfo JSON payload to include dashName. |
| nginx-transcoder/nginx-no-ssl.conf | Applies the same /nginxInfo JSON payload change for non-SSL mode. |
Suppressed comments (2)
nginx-transcoder/nginx.conf:163
- This JSON is built by string concatenation with
${FFMPEG_FLAGS}. The repo’s own docker-compose example forFFMPEG_FLAGSincludes double quotes (e.g.-filter:v:0 "scale=320:-1"), which would make/nginxInfoemit invalid JSON and potentially allow response-shaping if quotes/newlines appear. If/nginxInfois intended to be machine-readable, consider encoding/escapingFFMPEG_FLAGS(e.g., URL/base64 encoding) or changing the response shape so it can’t be broken by quotes.
return 200 '{"ffmpegFlags":"${FFMPEG_FLAGS}","dashName":"${DASH_NAME}"}';
nginx-transcoder/nginx-no-ssl.conf:146
- This JSON is built by string concatenation with
${FFMPEG_FLAGS}. The repo’s own docker-compose example forFFMPEG_FLAGSincludes double quotes (e.g.-filter:v:0 "scale=320:-1"), which would make/nginxInfoemit invalid JSON and potentially allow response-shaping if quotes/newlines appear. If/nginxInfois intended to be machine-readable, consider encoding/escapingFFMPEG_FLAGS(e.g., URL/base64 encoding) or changing the response shape so it can’t be broken by quotes.
return 200 '{"ffmpegFlags":"${FFMPEG_FLAGS}","dashName":"${DASH_NAME}"}';
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # static nginx runtime info served to webtools | ||
| location /nginxInfo { | ||
| return 200 '{"ffmpegFlags":"${FFMPEG_FLAGS}"}'; | ||
| return 200 '{"ffmpegFlags":"${FFMPEG_FLAGS}","dashName":"${DASH_NAME}"}'; | ||
| } |
| # static nginx runtime info served to webtools | ||
| location /nginxInfo { | ||
| return 200 '{"ffmpegFlags":"${FFMPEG_FLAGS}"}'; | ||
| return 200 '{"ffmpegFlags":"${FFMPEG_FLAGS}","dashName":"${DASH_NAME}"}'; | ||
| } |
The endpoint returns JSON but the location set no type, so it inherited the default octet-stream and browsers offered it as a download. Predates this change, but this PR already edits both blocks.
|
Fair point, and taken. It predates this change, but the PR is already editing both
|
Both PRs were cut from this fork, so their changes arrive as conflicts against the local copies they were taken from. Upstream's side wins in all three: it is the same change plus the content-type line that review added. The deployment-only patches in these files are untouched.
/nginxInfoexists to tell a client how this server is configured, and currently returns onlyffmpegFlags.The manifest is written to
${DASH_NAME}.mpd. That name is configurable and need not match the publish name, so a client has no reliable way to work out which URL to request. This adds the field it would need:{"ffmpegFlags":"...","dashName":"..."}One field, added to both
nginx.confandnginx-no-ssl.confso the two stay identical.