HUB
Sign inSign up
nginx logo

dgcosenza/nginx

By dgcosenza

•Updated about 13 hours ago

Source-built NGINX 1.30 + Brotli + PHP 8.4 FPM on Debian 13, /config parity, 0 fixable CVEs.

Image
0

3.6K

dgcosenza/nginx repository overview

⁠NGINX + Brotli + PHP 8.4 FPM — Debian 13 (trixie-slim) Image

Daily CI OpenSSF Scorecard Workflow Gitleaks Secret Scan Public Content Check OpenSSF Scorecard OpenSSF Best Practices

Trivy + Grype: 0 Fixable CVEs Signed: Cosign OIDC SLSA Build L3 SBOM: SPDX + CycloneDX Base OS Architectures Healthcheck: CI Verified Renovate Enabled Dependabot Enabled Daily Rebuilds

Latest Release Release Date Last Commit Docker Pulls Docker Image Size Registries: Docker Hub + GHCR Packaging License: MIT Upstream License GitHub Issues FNX Labs Catalog

A source-built NGINX (stable 1.30.x with HTTP/3, Brotli, and PHP 8.4 FPM) container image on Debian 13 (trixie-slim) with drop-in /config layout compatibility, maintained by Daniel G. Cosenza from FNX Labs.


⁠Overview

dgcosenza/nginx builds the latest official stable NGINX release from nginx.org alongside dynamic ngx_brotli modules (linked dynamically to Debian 13's libbrotli1) and Debian 13's PHP 8.4 FPM stack on fully upgraded debian:trixie-slim:

  • Drop-in /config compatibility: Preserves PUID/PGID (user abc), /config/nginx/nginx.conf (included from /etc/nginx/nginx.conf), /config/nginx/site-confs/*.conf, /config/nginx/ssl.conf, /config/keys/cert.{crt,key}, /config/php/php-local.ini, /config/php/www2.conf, /config/log/, and /config/www/.
  • Built-in Brotli & PHP-FPM: Ships /etc/nginx/modules/10_http_brotli.conf (ngx_http_brotli_filter_module.so + ngx_http_brotli_static_module.so) and php-fpm8.4 listening on 127.0.0.1:9000 with common extensions (apcu, bcmath, bz2, curl, gd, gmp, igbinary, intl, ldap, mbstring, memcached, msgpack, mysql, pgsql, redis, soap, sqlite3, xml, xsl, zip).
  • Built-in config auto-reload: Enable AUTO_RELOAD=true (or keep DOCKER_MODS=linuxserver/mods:swag-auto-reload) to watch /config/nginx via inotifywait and reload NGINX automatically after nginx -t validation — no external runtime mod downloads needed.
  • Hardened & CVE-gated (all severities with a fix): Runs with tini as PID 1, compatible with security_opt: no-new-privileges:true, workers run as non-root abc, and every daily build enforces 0 fixable findings of any severity in both Trivy and Grype.

⁠Current Versions

ComponentResolved Version
NGINX1.30.8
ngx_brotli53e0fb5
PHP-FPM8.4.28
Base OSDebian 13.8 (trixie-slim)
Architectureslinux/amd64, linux/arm64
Uncompressed size (per arch)amd64: 90.8 MB, arm64: 264.8 MB
Last verified build (UTC)2026-11-28
Published multi-arch digestdgcosenza/nginx@sha256:9708eaec9e35827dabf07e591c0c6abf2221352952df3efdec3c2e772bc5778b
GHCR mirrorghcr.io/dgcosenza/nginx@sha256:9708eaec9e35827dabf07e591c0c6abf2221352952df3efdec3c2e772bc5778b
Supply chainCosign OIDC signed + SPDX & CycloneDX SBOM attestations + SLSA Build L3 provenance
Security gate (Trivy + Grype on SBOM)0 fixable findings of any severity (30 upstream-unfixed)

⁠Supported Tags

TagPolicyDescription
<version>-<YYYYMMDD> (e.g. 1.30.8-20261124)ImmutableDate-stamped daily rebuild pinning the NGINX stable release and UTC build date.
sha-<short>ImmutablePackaging repository Git commit tag.
<version> (e.g. 1.30.8)MovingLatest verified Debian 13 rebuild of that NGINX release.
latestMovingLatest verified build tracking the newest official stable NGINX release.

Production pinning: Pin by registry digest rather than pulling unpinned :latest:

image: dgcosenza/nginx:latest@sha256:<digest>

⁠Supported Architectures

ArchitectureStatusVerification
linux/amd64Published & natively testedBuilt, smoke-tested, Dive-gated, Syft/Trivy/Grype-scanned, and Cosign-signed on native x86_64 CI runners.
linux/arm64Published & natively testedBuilt, smoke-tested, Dive-gated, Syft/Trivy/Grype-scanned, and Cosign-signed on native ARM64 CI runners.

⁠Identical multi-arch OCI manifest digests are published to Docker Hub and GHCR (ghcr.io/dgcosenza/*), accompanied by automated signed GitHub Releases⁠.

⁠Quick Start

⁠docker run
docker run -d \
  --name nginx \
  --restart unless-stopped \
  --security-opt no-new-privileges:true \
  -p 192.0.2.10:443:443 \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  -e AUTO_RELOAD=true \
  -v "$(pwd)/config:/config" \
  dgcosenza/nginx:latest
⁠Docker Compose

See docker-compose.example.yml⁠:

services:
  nginx:
    image: dgcosenza/nginx:latest
    container_name: nginx
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    ports:
      - "192.0.2.10:443:443"
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - AUTO_RELOAD=true
    volumes:
      - ./config:/config
    healthcheck:
      test: ["CMD-SHELL", "curl -sk -o /dev/null -w '%{http_code}' --max-time 5 https://127.0.0.1/ | grep -qE '^(200|301|302|401)$$'"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 30s

⁠Configuration

⁠Environment Variables
VariableRequiredDefaultDescription
PUIDNo1000UID assigned to the abc NGINX/PHP-FPM worker user.
PGIDNo1000GID assigned to the abc NGINX/PHP-FPM worker group.
TZNoEtc/UTCContainer timezone (IANA timezone name).
AUTO_RELOADNofalseSet true to watch /config/nginx with inotifywait and reload NGINX after nginx -t succeeds. Also activates automatically if DOCKER_MODS contains auto-reload.
⁠Volumes, Ports, and UID/GID
Path / PortMode / OwnerPurpose
/config/nginx/PUID:PGIDnginx.conf, ssl.conf, worker_processes.conf, resolver.conf, real-ip.conf, dhparams.pem, site-confs/*.conf. Existing files are never overwritten.
/config/keys/PUID:PGIDTLS certificate (cert.crt) and private key (cert.key, auto-generated self-signed on fresh boot if absent).
/config/php/PUID:PGIDphp-local.ini (loaded into FPM & CLI) and www2.conf (appended to [www] pool overrides).
/config/www/PUID:PGIDDefault web root for static and PHP content.
/config/log/PUID:PGIDnginx/access.log, nginx/error.log, php/error.log.
80/tcp, 443/tcpContainer portsHTTP and HTTPS listeners (bind explicitly to your LAN/proxy interface).

⁠Healthcheck

HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
    CMD ["sh", "-c", "curl -sk -o /dev/null -w '%{http_code}' --max-time 5 https://127.0.0.1/ | grep -qE '^(200|301|302|401)$'"]

Probes the local HTTPS endpoint and succeeds on HTTP 200, 301, 302, or 401 (supporting HTTP Basic Auth default vhosts).


⁠Upgrading and Migrating from lscr.io/linuxserver/nginx

This image is designed as a drop-in replacement for existing /config volumes:

  1. Back up ./config and tag your outgoing image for rollback.
  2. Test side-by-side against a copy of ./config on non-conflicting loopback ports and run docker exec <trial> nginx -t.
  3. Note: If any custom vhost relies on third-party dynamic NGINX modules other than ngx_brotli (such as Lua or RTMP), remove those directives or build with the extra module before cutover. Standard reverse-proxy, TLS, Brotli, HTTP Basic Auth, and PHP-FPM (127.0.0.1:9000) configurations work without changes.
  4. Pin image: dgcosenza/nginx:latest@sha256:<digest> in Compose and recreate the service (docker compose up -d nginx).

⁠Supply-Chain Verification

Every published digest (multi-arch index and per-architecture manifests) on both Docker Hub and GHCR is keyless-signed with Sigstore Cosign (GitHub OIDC), attested with SPDX and CycloneDX SBOMs, and backed by SLSA Build L3 provenance (actions/attest-build-provenance).

⁠Verify image signature with Cosign
cosign verify \
  --certificate-identity-regexp="^https://github\.com/dgcosenza/nginx-docker/\.github/workflows/daily\.yml@refs/heads/main$" \
  --certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
  ghcr.io/dgcosenza/nginx:latest

# Or against Docker Hub (identical digest):
cosign verify \
  --certificate-identity-regexp="^https://github\.com/dgcosenza/nginx-docker/\.github/workflows/daily\.yml@refs/heads/main$" \
  --certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
  dgcosenza/nginx:latest
⁠Verify SPDX / CycloneDX SBOM attestations and SLSA Build Provenance
cosign verify-attestation \
  --type spdxjson \
  --certificate-identity-regexp="^https://github\.com/dgcosenza/nginx-docker/\.github/workflows/daily\.yml@refs/heads/main$" \
  --certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
  ghcr.io/dgcosenza/nginx@sha256:<arch-digest>

gh attestation verify oci://ghcr.io/dgcosenza/nginx:latest --owner dgcosenza

⁠Security

  • Vulnerability scan policy (all severities with a fix): Every CI build runs Trivy (table, JSON, SARIF upload to Code Scanning, and blocking --ignore-unfixed gate) and Grype (--only-fixed, severity cutoff negligible, blocking gate), plus generates an SPDX SBOM (sbom.spdx.json) and provenance artifact. Publication is blocked on any fixable finding of any severity.
  • Current status: 0 fixable vulnerabilities of any severity across Debian 13 OS packages, PHP 8.4, and source-built NGINX.
  • Hardening: tini PID 1, no-new-privileges:true compatible, worker processes drop to non-root abc (PUID:PGID), compilers excluded from runtime layer, server_tokens off and expose_php = Off in defaults.
  • See SECURITY.md⁠.

⁠Build Locally

git clone https://github.com/dgcosenza/nginx-docker.git
cd nginx-docker

docker buildx build \
  --platform linux/amd64 \
  --load \
  --build-arg BUILD_DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
  --build-arg IMAGE_REVISION="$(git rev-parse HEAD)" \
  -t dgcosenza/nginx:local \
  .
Build ArgDefaultPurpose
NGINX_VERSION1.30.8Official stable NGINX release from nginx.org (overridden daily by CI).
NGX_BROTLI_COMMIT53e0fb55f250f48fe80c0ddbf6c0f7103cdbaae1Pinned google/ngx_brotli commit SHA.
DEBIAN_BASEdebian:trixie-slimBase OS image.
BUILD_DATEunknownRFC 3339 UTC build timestamp.
IMAGE_REVISION""Packaging repository Git SHA.
IMAGE_SOURCEhttps://github.com/dgcosenza/nginx-dockerSource URL for OCI labels.

⁠Update Policy

.github/workflows/daily.yml⁠ runs automatically every day at 04:31 UTC, on pushes to main, on pull requests (verification only, without pushing), and via workflow_dispatch. Every scheduled run executes a seven-step automated pipeline (gated by .github/workflows/public-check.yml):

  1. Upstream check: Resolves the latest official stable NGINX release from nginx.org and the debian:trixie-slim base digest, diffs against versions.json, and emits upstream-changes.md.
  2. No-cache rebuild: Rebuilds linux/amd64 with --no-cache on schedule, compiles NGINX + ngx_brotli, upgrades Debian 13 packages and PHP 8.4 security updates (apt-get update && apt-get -y upgrade), and generates an SPDX SBOM (sbom.spdx.json) and provenance artifact.
  3. Vulnerability fix and gate: Runs Trivy (table, JSON, SARIF upload, blocking --ignore-unfixed gate) and Grype (blocking --only-fixed gate, severity cutoff negligible), diffs findings against the previous scan to record resolved CVEs, and retains reports for 90 days.
  4. Smoke test: Runs tests/smoke.sh⁠ to verify fresh /config initialization, tini PID 1, non-root abc NGINX and PHP-FPM workers, HTTPS 200, Brotli (Content-Encoding: br), PHP 8.4 execution, and a negative closed-port healthcheck test.
  5. Publish: On non-PR builds when Docker Hub secrets are configured, pushes latest, <version>, <version>-<YYYYMMDD>, and sha-<short> tags to Docker Hub and records the immutable digest.
  6. Automated documentation sync: Commits updated versions.json, the README Current Versions block, and a dated CHANGELOG.md entry via github-actions[bot] with [skip ci] when content changes, then syncs Docker Hub overview and short description via peter-evans/dockerhub-description.
  7. Failure alerting: If any step fails on main or a scheduled run, CI opens or updates a single GitHub issue labeled ci-failure with the failing job and run link, and automatically closes it on the next green run.

⁠Design Decisions

  • Source-built official stable NGINX (1.30.x) on Debian 13 (trixie-slim): Avoids downgrading to Debian 13's distro-frozen nginx 1.26.x while retaining Debian 13 glibc, OpenSSL 3, PHP 8.4, and daily Debian Security updates.
  • Dynamically linked ngx_brotli: Links ngx_brotli against Debian 13's libbrotli1 rather than bundling static C sources so Debian Security patches apply automatically.
  • Built-in inotifywait auto-reload: Eliminates third-party runtime container mod downloads while maintaining drop-in compatibility with existing DOCKER_MODS / AUTO_RELOAD Compose configurations.

⁠License

This repository follows a clear packaging-vs-upstream license split:

  • Container packaging, scripts, CI workflows, and documentation (packaging: MIT): Licensed under the MIT License⁠ — copyright Daniel G. Cosenza from FNX Labs.
  • Bundled upstream software — NGINX (nginx/nginx, plus google/ngx_brotli and Debian 13 PHP 8.4) (upstream: BSD-2-Clause): NGINX⁠ and google/ngx_brotli⁠ are licensed under the 2-Clause BSD License (BSD-2-Clause)⁠; PHP 8.4 is licensed under the PHP License v3.01.

Full third-party notices are maintained in THIRD-PARTY-NOTICES.md⁠. Release history is maintained in CHANGELOG.md⁠.

Tag summary

Content type

Image

Digest

sha256:9708eaec9…

Size

86.6 MB

Last updated

about 13 hours ago

docker pull dgcosenza/nginx