docs(rum): explain that compressed HTML is not injected #503
<a target='_blank' href='https://app.datadoghq.com/ci/pipeline-executions?query=ci_level%3Ajob+%40git.commit.sha%3A38fb95d875740042fc97afcdf88e852fd0a5fe56&referrer=pr-comment&start=1795677326000'><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.datadoghq.com/static/images/pr_comments/software_delivery/badges_header/pipelines-ok.svg"/><img src="https://static.datadoghq.com/static/images/pr_comments/software_delivery/badges_header/pipelines-ok-light.svg" alt="Pipelines" align="center" /></picture></a> <a target='_blank' href='https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest+%40git.commit.sha%3A0b91c99feae3dca5548b11bc2805211b0c466a96&referrer=pr-comment&start=1795677326000'><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.datadoghq.com/static/images/pr_comments/software_delivery/badges_header/tests-ok.svg"/><img src="https://static.datadoghq.com/static/images/pr_comments/software_delivery/badges_header/tests-ok-light.svg" alt="Tests" align="center" /></picture></a>
<details><summary><b>🎉 All green!</b></summary>
🧪 All tests passed
❄️ No new flaky tests detected
</details>
🎯 Code Coverage (<a target='_blank' href='https://app.datadoghq.com/ci/code-coverage/github.com%2Fdatadog%2Fnginx-datadog/pull-requests/503'>details</a>)<br>• <strong><span title="Percentage of modified executable lines covered by tests in this PR">Patch Coverage</span></strong>: 100.00%<br>• <strong><span title="Percentage of all executable lines covered by tests in the entire codebase">Overall Coverage</span></strong>: 70.11% <span title="Change in overall coverage compared to the base branch">(+0.00%)</span><br>
<sub>
This comment will be updated automatically if new data arrives. <br />
🔗 Commit SHA: 38fb95d | <a href="https://docs.datadoghq.com/integrations/guide/source-code-integration/#pr-comments">Docs</a> | <a href="https://app.datadoghq.com/ci/pull-request/Z2l0aHViLmNvbS9kYXRhZG9nL25naW54LWRhdGFkb2cvNTAz?referrer=pr-comment">View more details</a> | Give us <a href="https://dd.enterprise.slack.com/archives/C07E3U2QRMM">feedback</a>!
</sub>
<!-- codex-pull-request-review-summary -->
<!-- codex-review-state:v1 {"code_review":{"commit_sha":"fc0680f9d760fa01f39bd5e31e034f5c2e8c5247","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":"fc0680f9d760fa01f39bd5e31e034f5c2e8c5247","has_any_findings":null,"has_unresolved_findings":null,"status":"completed"}} -->
<!-- codex-security-review:v1 {"blockingSeverityThreshold":"P0","headSha":"fc0680f9d760fa01f39bd5e31e034f5c2e8c5247","mergeGateEnabled":false,"pullRequestNumber":503,"repository":"DataDog/nginx-datadog","status":"completed"} -->
<details>
<summary><strong>Codex Review Summary</strong>: ✅ Completed</summary>
This comment shows the latest Codex review activity on this pull request.
| Review | Status | Commit | Review trigger |
| --- | --- | --- | --- |
| 📝 Code Review | ✅ Completed <relative-time datetime="2026-11-25T12:44:51.460351Z">2026-11-25T12:44:51.460351Z</relative-time> | fc0680f | Draft marked ready |
| 🔒 Security Review | ✅ Completed <relative-time datetime="2026-11-25T12:47:19.653174Z">2026-11-25T12:47:19.653174Z</relative-time> | fc0680f | Draft marked ready |
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
</details>
</details>
Approved these changes.
_nit_:
So that _could_ be:
## Real User Monitoring (RUM) Injection
The RUM flavor of the Datadog Nginx module injects the Datadog RUM Browser SDK…
_nit_: capitalize titles
Maybe document each of these two directives with a (small) dedicated section, as the other directives listed in the file.
_opt_: maybe use a list:
With this setup:
- The traffic […]
- A `proxy_set_header` […]
- If Nginx […]
Nice.
Done in 38fb95d: the acronym is now spelled out. I kept "RUM builds" to match the "(AppSec builds)" wording used in the rest of the file.
Done in 38fb95d.
Done in 38fb95d: added small sections for datadog_rum and datadog_rum_config.
Done in 38fb95d.
pawelchcki
iamluc
Overview
Document that RUM injection is skipped when the HTML response already has a
Content-Encodingheader, and how to work around it: ask the backend for uncompressed HTML
(
proxy_set_header Accept-Encoding "";) and let Nginx compress it (gzip on;).Motivation
Users with a backend that gzips HTML get no injection and do not know why.
Additional Notes
Tested in Docker with the module built from
master(RUM=ON NGINX_VERSION=1.31.10 make build-musl,image
nginx:1.31.10-alpine), a backend that gzips HTML only when asked, and a client sendingAccept-Encoding: gzip:RUM SDK injection skipped: compressed html content.locationblock: backend receives an emptyAccept-Encoding, the clientgets
Content-Encoding: gzip, and the decompressed body contains the RUM snippet.nginx-debuglogs show the Datadog body filter runs beforehttp gzip filter.References
Jira ticket: INPLAT-1455
Contributor Checklist