nginx

Use this skill when helping with Nginx or OpenResty/Lua development tasks. Triggers include writing or debugging Nginx configuration (server blocks, location blocks, upstreams, proxy_pass, rewrites, maps, try_files), OpenResty/Lua module development (content handlers, access control, header manipulation, shared dictionaries, cosocket usage), and Nginx performance tuning (buffer sizing, keepalive tuning, caching, connection pooling, benchmarking). Also use when the user mentions .conf files, nginx.conf, lua modules in the context of a web server/reverse proxy/CDN, or any directive-level Nginx questions. Do NOT use for Apache, Caddy, HAProxy, or general web server questions unrelated to Nginx.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "nginx" with this command: npx skills add nejclovrencic/nginx-agent-skills/nejclovrencic-nginx-agent-skills-nginx

Nginx & OpenResty Development

Core Guidance

When writing or reviewing Nginx configuration:

  1. Always consider the directive inheritance model. Child blocks inherit from parent unless they redefine the directive. For example, adding one proxy_set_header in a location block wipes all inherited proxy_set_header directives from the server block.
  2. Prefer map over if for conditional logic. if in location context is dangerous and only reliably supports return and rewrite. See references/nginx-gotchas.md for the full list.
  3. Always clarify proxy_pass trailing-slash behavior — it is the single most common source of subtle bugs.
  4. When writing upstream blocks, always include keepalive configuration and explain connection pooling implications.
  5. When writing Nginx directives, always check docs, specifically module references, to verify that a directive actually exists, and what values it accepts (on/off, variable, fixed values, etc).

When writing OpenResty/Lua code:

  1. Always check phase restrictions before using cosocket or subrequest APIs. See references/openresty-api.md.
  2. Prefer ngx.ctx over ngx.var for passing data between phases because it's more performant.
  3. Avoid using ngx.var multiple times for the same variable, as it's less performant than accessing Lua variable.
  4. Use ngx.timer.at for background/async work, never block the event loop.

When advising on performance:

  1. Consult references/testing-patterns.md for benchmarking methodology.
  2. Always consider the full request path: client → Nginx → upstream, and tune each segment.
  3. Buffer sizing has cascading effects — refer to the buffer tuning section in references/nginx-gotchas.md.

Reference Files

Load these as needed based on the task:

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

nginx

No summary provided by upstream source.

Repository SourceNeeds Review
General

nginx

No summary provided by upstream source.

Repository SourceNeeds Review
General

nginx

No summary provided by upstream source.

Repository SourceNeeds Review