Skip to content

docs: add a configuration operations guide - #25

Merged
joey-huckabee merged 1 commit into
mainfrom
docs/configuration-operations
Sep 17, 2026
Merged

joey-huckabee merged 1 commit into
mainfrom
docs/configuration-operations

Conversation

@joey-huckabee

Copy link
Copy Markdown
Contributor

Closes the Package 3 item for documenting configuration mounting, validation,
reload, rollback, logging, troubleshooting, and secret redaction.

Every procedure was run against the built image before being written down.

The finding that justifies the guide

A bind mount of a single configuration file resolves to that file's inode.
Replacing the file by rename — what sed -i, most editors, and every
write-then-mv deployment does — creates a new inode. The mount still points at
the old one.

The reload then reports success while the previous configuration stays
live. Nothing errors. Nothing warns.

Verified in all three directions:

Action Inode Reload result
In-place rewrite (cat >) unchanged (488 → 488) new config live
Replace by rename (sed -i, mv) new old config still live, reload reported success
Rename inside a mounted directory new new config live

So the guide's rule is: mount the directory, point NGINX at a file inside it.
I found this because my first attempt to test reload used sed -i and nothing
changed — which looked like a reload bug and was not.

Other verified content

  • nginx -t exits 1 on an invalid configuration and 0 on a valid one, so
    it can gate a deployment. Confirmed properly — my first measurement read the
    exit code of a pipeline rather than podman's.
  • Validation should carry the same restrictions as the deployment. A config can
    pass without them and still fail under a read-only root or arbitrary UID.
  • Two permission failures that present as configuration bugs: a 0700
    directory answering 403 on every request, and the Podman/Docker difference
    in how mounted file ownership reaches the runtime identity — both hit during
    this work, in feat: add a qualified preview request-limiting profile #18 and feat: add qualified preview HTTP and TLS profiles #15 respectively.

Redaction

Restates the two rules that matter when editing configuration: log the path and
never the request line, and check what sits downstream, because a collector or
front proxy recording full request lines reintroduces exactly what the profiles
exclude.

Roadmap

Package 3 drops to three open items: DNS and upstream-verification defaults,
and the two blocked on a chosen logging platform and an exact supported host.

🤖 Generated with Claude Code

Cover mounting, validating a candidate, reloading, rollback, troubleshooting,
and secret redaction, with every procedure exercised against the built image
before being written down.

The finding worth the guide on its own: a bind mount of a single configuration
file resolves to that file's inode, so replacing the file by rename leaves the
container on the previous inode. That is what `sed -i`, most editors, and every
write-then-move deployment does. The subsequent reload then reports success
while the old configuration stays live, which is the worst shape a failure can
take. Verified both directions: an in-place rewrite preserving the inode is
picked up, a rename is not, and mounting the containing directory instead makes
an atomic rename work normally.

Also records that `nginx -t` exits 1 on an invalid configuration so it can gate
a deployment, that validation should carry the same restrictions the deployment
uses because a configuration can pass without them and still fail to start
under a read-only root or an arbitrary UID, and the permission failures that
present as configuration bugs: a 0700 directory answering 403, and the Podman
and Docker difference in how mounted file ownership reaches the runtime
identity.
@joey-huckabee
joey-huckabee merged commit b9d224f into main Sep 17, 2026
5 checks passed
@joey-huckabee
joey-huckabee deleted the docs/configuration-operations branch September 17, 2026 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant