deploy-nginx

deploy-nginx is a command for Claude Code from trumb/claude-nginx-hardening. It costs 22 tokens per session (2,083 once invoked), scanned A, original, MIT.

A deployment command for applying already-approved Nginx security changes. Nginx is web-server software; the command backs up the current configuration, checks the proposed rules, tests them, reloads Nginx, and can push or deploy remotely.

In plain words
What is it for?
Use it to deploy accepted Nginx hardening changes locally, to a Git repository, or to a remote server.
Why use it?
It turns staged security changes into a controlled deployment with backups and validation. It also requires explicit approval before making changes.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 scripts/invariant-checker.py --proposed <proposed-config> --backup <current-config> --require-backup.

Part of the claude-nginx-hardening plugin — 1 skill, 8 commands, 3 agents shipped together

Good fit Use it to deploy accepted Nginx hardening changes locally, to a Git repository, or to a remote server.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/trumb/claude-nginx-hardening
agentmods
npx agentmods add commands/trumb/claude-nginx-hardening/deploy-nginx

Made for: Claude Code.

Or install claude-nginx-hardening, the plugin that ships this one along with the rest of its 1 skill, 8 commands, 3 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for deploy-nginx

README.md
[![agentmods](https://agentmods.dev/badge/commands/trumb/claude-nginx-hardening/deploy-nginx/github.svg)](https://agentmods.dev/commands/trumb/claude-nginx-hardening/deploy-nginx)
Your own site
<a href="https://agentmods.dev/commands/trumb/claude-nginx-hardening/deploy-nginx"><img src="https://agentmods.dev/badge/commands/trumb/claude-nginx-hardening/deploy-nginx/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for deploy-nginx

Your own site · 80×15
<a href="https://agentmods.dev/commands/trumb/claude-nginx-hardening/deploy-nginx"><img src="https://agentmods.dev/badge/commands/trumb/claude-nginx-hardening/deploy-nginx.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,083 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00022 $0.02083
Opus 5 $0.00011 $0.01042
Sonnet 5 $0.00004 $0.00417
Haiku 4.5 $0.00002 $0.00208

Measured 8d ago against content hash cc4671d2531f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

deploy-nginx scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootlowPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo cp /etc/nginx/snippets/security-hardening.conf /etc/nginx/snippets/security-hardening.conf.bak.$(date +%Y%m%d-%H%M%S)

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

commands/deploy-nginx.md · 212 lines

How it starts

The opening of the file, as written. The whole thing — 212 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Context

  • Staged outputs: !ls -d outputs/run-* 2>/dev/null | tail -1 || echo "no staged runs found"
  • Nginx status: !systemctl is-active nginx 2>/dev/null || echo "unknown"

Operating Mode

This command performs WRITES. Explicit approval required.

Default: W1 (local write) With --push: W1 + W2 (local + git push) With --remote: W1 + W2 + X1 (local + git push + remote deploy)

Read @skills/nginx-hardening/EXECUTION-POLICY.md for full policy. Read @skills/nginx-hardening/INVARIANTS.md — ALL invariants enforced.

Your Task

Deploy previously staged and accepted changes from a run's output directory.

Prerequisites

Before deploying, verify:

  1. A staged run exists in outputs/<run-id>/
  2. The run has accepted proposed rules
  3. User has explicitly confirmed they want to deploy

Deployment Steps

Step 1: Identify Changes Read outputs/<run-id>/proposed-rules/ and show the user exactly what will change.

Step 2: Validate (Deterministic)

# Run invariant checker against proposed changes
python3 scripts/invariant-checker.py --proposed <proposed-config> --backup <current-config> --require-backup

# Validate any new exceptions or learnings
python3 scripts/schema-validator.py --type <type> --file <file>

If ANY validation fails → abort deploy, show errors.

Step 2b: Compatibility Check

# Run all 9 compatibility checks against proposed config
python3 scripts/compatibility-checker.py --proposed <proposed-config> --current <current-config> --profile <profile>
  • If any check returns critical severity → abort deploy, show the failing checks
  • If checks return warning severity → display warnings, require explicit user confirmation to proceed
  • See @skills/nginx-hardening/COMPATIBILITY-CHECKS.md for the full check reference

Step 2c: Blast-Radius Analysis

# Analyze which sites/upstreams are affected by the proposed changes
python3 scripts/blast-radius.py --proposed <proposed-config> --current <current-config>
  • Present the blast-radius summary to the user before proceeding:
    • Number of server blocks affected
    • List of affected domains/listen directives
    • Upstream dependencies impacted
    • Estimated traffic scope (if log data available)
  • Pause for user confirmation — user must explicitly approve after reviewing blast radius

Read the full file on GitHub · 212 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 212 lines · 22 tokens per session scan A cc4671d2531f

Subscribe to this mod's changes

deploy-nginx is a command published in the GitHub repository trumb/claude-nginx-hardening (2 stars, last pushed 5mo ago), licensed MIT. It adds 22 tokens to every session and 2,083 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.