Nginx crash-loops after container restart: base image ships brotli_static in discourse.conf but never loads the module (unknown directive)

Summary
After a routine container restart (host reboot / docker restart), nginx fails to start inside the app container with:

nginx: [emerg] unknown directive "brotli_static" in /etc/nginx/conf.d/discourse.conf:172

This puts the whole site down (no fallback — nginx never binds to 80/443) until manually patched.

Environment

  • Base image: discourse/base:2.0.20260812-0036
  • nginx: 1.26.3-3+deb13u7 (Debian 13/trixie package, not custom-compiled)
  • libnginx-mod-http-brotli-static/-filter 1.0.0~rc-6 are installed, and /etc/nginx/mods-enabled/*.conf symlinks (with correct load_module lines) exist and point to valid .so files.

Root cause
/etc/nginx/nginx.conf (owned by the nginx-common package, unmodified) has no include /etc/nginx/modules-enabled/*.conf; directive, so the installed Brotli modules are never loaded — while discourse.conf (generated by the Discourse templates) still emits brotli_static on; assuming they are.

Why it doesn’t fail immediately
The config only gets re-parsed when nginx actually (re)starts. A freshly rebuilt container can run fine for days/weeks until something restarts nginx (host reboot, docker restart, OOM, etc.), at which point it silently starts crash-looping (~1×/sec) with no automatic recovery.

Workaround
Add include /etc/nginx/modules-enabled/*.conf; as the first line of /etc/nginx/nginx.conf (main context, before events {}). Confirmed this restores nginx -t success and normal operation.

Ask
Could the base image either (a) add this include to its nginx.conf, or (b) drop brotli_static/brotli from the shipped discourse.conf template if the distro nginx package build no longer bundles Brotli support by default?