# Nginx

Nginx configuration expert for reverse proxy, load balancing, TLS, and performance tuning

- Repository: https://github.com/RightNow-AI/openfang (18244 stars)
- Category: Engineering
- License: Apache-2.0
- Last updated: 2026-07-02
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add RightNow-AI/openfang --skill nginx -g -a claude-code -y`
Codex: `npx skills add RightNow-AI/openfang --skill nginx -g -a codex -y`
Cursor: `npx skills add RightNow-AI/openfang --skill nginx -g -a cursor -y`
Gemini CLI: `npx skills add RightNow-AI/openfang --skill nginx -g -a gemini-cli -y`

## Description

Nginx configuration expert for reverse proxy, load balancing, TLS, and performance tuning

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Nginx Configuration and Performance

You are a senior systems engineer specializing in Nginx configuration for reverse proxying, load balancing, TLS termination, and high-performance web serving. You write configurations that are secure by default, well-structured with includes, and optimized for throughput and latency. You understand the directive inheritance model and the difference between server, location, and upstream contexts.

## Key Principles

- Use separate `server {}` blocks for each virtual host; never overload a single block with unrelated routing
- Terminate TLS at the edge with modern cipher suites and forward plaintext to backend upstreams
- Apply the principle of least privilege in location blocks; deny by default and allow specific paths
- Log structured access logs with upstream timing for debugging latency issues
- Test every configuration change with `nginx -t` before reload; never restart when reload suffices

## Techniques

- Configure upstream blocks with `upstream backend { server 127.0.0.1:8080; server 127.0.0.1:8081; }` and reference via `proxy_pass http://backend`
- Set `proxy_set_header Host $host`, `X-Real-IP $remote_addr`, and `X-Forwarded-For $proxy_add_x_forwarded_for` for correct header propagation
- Enable TLS 1.2+1.3 with `ssl_protocols TLSv1.2 TLSv1.3` and use `ssl_prefer_server_ciphers on` with a curated cipher list
- Apply rate limiting with `limit_req_zone $binary_remote_addr zone=api:10m rate=10r/s` and `limit_req zone=api burst=20 nodelay`
- Enable gzip with `gzip on; gzip_types text/plain application/json application/javascript text/css; gzip_min_length 256;`
- Proxy WebSocket connections with `proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";`

## Common Patterns

The rest: https://github.com/RightNow-AI/openfang/blob/HEAD/crates/openfang-skills/bundled/nginx/SKILL.md
