Nginx Error: unknown directive "brotli" on Stock Ubuntu Package

Stock `nginx` package omits third-party `ngx_brotli` module unless explicitly installed.

Runs locally in browser Free · No login Independently Verified 2026-11-25 v4.1.0
Identifier: Nginx Error Platform: Nginx
Common Root Causes:
  • Stock `nginx` package omits third-party `ngx_brotli` module unless explicitly installed.

Interactive Diagnostic Checklist

Verified Solutions:
  1. Install `libnginx-mod-http-brotli-static` or use built-in `gzip` + `gzip_static`.
Safe Diagnostic Command:
nginx -V 2>&1 | grep -i brotli
Warning: Verify configuration changes in staging or with dry-run flags (e.g. nginx -t) before reloading production services.

Technical Explanation

Stock `nginx` package omits third-party `ngx_brotli` module unless explicitly installed. Recommended diagnostic: `nginx -V 2>&1 | grep -i brotli`. Remediation: Install `libnginx-mod-http-brotli-static` or use built-in `gzip` + `gzip_static`.

Worked Examples

  • Run `nginx -V 2>&1 | grep -i brotli` to verify root cause before applying the remediation.

Limitations & Assumptions

  • Always verify configuration changes in staging or with dry-run flags (e.g. `nginx -t`) before reloading production services.

Source References & Verification

Resource ID: err-http-brotli-module-missing-nginx · Independently verified: 2026-11-25

Related Resources