Skillshub nginx-c-modules

nginx.org C Module Development Best Practices

install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/pproenca/dot-skills/nginx-c-modules" ~/.claude/skills/comeonoliver-skillshub-nginx-c-modules && rm -rf "$T"
manifest: skills/pproenca/dot-skills/nginx-c-modules/SKILL.md
source content

nginx.org C Module Development Best Practices

Comprehensive development guide for nginx C modules, derived from the official nginx development documentation and community expertise. Contains 49 rules across 8 categories, prioritized by impact to guide correct module implementation and prevent common crashes, memory leaks, and undefined behavior.

When to Apply

Reference these guidelines when:

  • Writing new nginx C modules (handlers, filters, upstream, load-balancers)
  • Implementing configuration directives and merge logic
  • Managing memory with nginx pools and shared memory zones
  • Handling the HTTP request lifecycle (body reading, subrequests, finalization)
  • Working with nginx's event loop, timers, and thread pools

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Memory ManagementCRITICAL
mem-
2Request LifecycleCRITICAL
req-
3Configuration SystemHIGH
conf-
4Handler DevelopmentHIGH
handler-
5Filter ChainMEDIUM-HIGH
filter-
6Upstream & ProxyMEDIUM
upstream-
7Event Loop & ConcurrencyMEDIUM
event-
8Data Structures & StringsLOW-MEDIUM
ds-

Quick Reference

1. Memory Management (CRITICAL)

2. Request Lifecycle (CRITICAL)

3. Configuration System (HIGH)

4. Handler Development (HIGH)

5. Filter Chain (MEDIUM-HIGH)

6. Upstream & Proxy (MEDIUM)

7. Event Loop & Concurrency (MEDIUM)

8. Data Structures & Strings (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information