nginx-config-generator
Generate production-ready nginx configuration files for reverse proxy, SSL, rate limiting, and caching setups. Use when you need an nginx config for a web application, API, static site, or reverse proxy. Triggers include "nginx config", "nginx configuration", "nginx setup", "reverse proxy config", "SSL nginx", "nginx rate limiting", or any request involving nginx web server configuration.
Best use case
nginx-config-generator is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Generate production-ready nginx configuration files for reverse proxy, SSL, rate limiting, and caching setups. Use when you need an nginx config for a web application, API, static site, or reverse proxy. Triggers include "nginx config", "nginx configuration", "nginx setup", "reverse proxy config", "SSL nginx", "nginx rate limiting", or any request involving nginx web server configuration.
Teams using nginx-config-generator should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/nginx-config-generator/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How nginx-config-generator Compares
| Feature / Agent | nginx-config-generator | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Generate production-ready nginx configuration files for reverse proxy, SSL, rate limiting, and caching setups. Use when you need an nginx config for a web application, API, static site, or reverse proxy. Triggers include "nginx config", "nginx configuration", "nginx setup", "reverse proxy config", "SSL nginx", "nginx rate limiting", or any request involving nginx web server configuration.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# nginx-config-generator Generate complete, validated nginx configuration files from a questionnaire or CLI flags. ## When to Use - Setting up nginx for a new web application - Adding SSL/TLS to an existing nginx server - Configuring nginx as a reverse proxy for Node.js, Python, PHP, or Go apps - Adding rate limiting or caching to protect a backend - Creating a multi-server virtual host configuration - Getting a starting point nginx config to customize ## Prerequisites 1. nginx-config-generator installed or running locally 2. (Optional) nginx binary installed for full config validation ## Installation ```bash npm install -g nginx-config-generator ``` Or run the web UI: ```bash docker compose up -d # Web UI at http://localhost:3000 ``` ## Quick Start ### CLI - Generate with flags ```bash nginx-conf generate \ --domain example.com \ --upstream 127.0.0.1:3000 \ --ssl \ --cert /etc/letsencrypt/live/example.com/fullchain.pem \ --key /etc/letsencrypt/live/example.com/privkey.pem \ --rate-limit \ --gzip \ --output nginx.conf ``` ### CLI - Apply a preset template ```bash nginx-conf templates apply nextjs \ --domain example.com \ --upstream 127.0.0.1:3000 \ --output nginx.conf ``` ### CLI - Interactive mode ```bash nginx-conf generate # Walks through all 4 steps interactively ``` ### CLI - From saved answers ```bash nginx-conf generate --from answers.json --output nginx.conf ``` ## CLI Reference | Command | Description | |---|---| | `nginx-conf generate` | Interactive questionnaire | | `nginx-conf generate [flags]` | Generate from flags | | `nginx-conf generate --from <file>` | Load answers from JSON | | `nginx-conf validate <file>` | Validate an nginx config | | `nginx-conf templates` | List available templates | | `nginx-conf templates apply <name>` | Generate from preset | | `nginx-conf --help` | Show help | | `nginx-conf --version` | Show version | ## Generate Flags | Flag | Description | Default | |---|---|---| | `--domain <name>` | Server name(s), space-separated | (required) | | `--upstream <addr>` | Upstream server address | - | | `--ssl` | Enable SSL | 0 | | `--cert <path>` | SSL certificate path | - | | `--key <path>` | SSL key path | - | | `--redirect-http` | 301 redirect HTTP to HTTPS | 1 (if --ssl) | | `--hsts` | Strict-Transport-Security header | 0 | | `--cipher-profile <name>` | modern, intermediate, or custom | intermediate | | `--rate-limit` | Enable rate limiting | 0 | | `--rate <n>` | Request rate (e.g. 10r/s) | 10r/s | | `--burst <n>` | Rate limit burst | 20 | | `--cache` | Enable proxy cache | 0 | | `--gzip` | Enable gzip compression | 1 | | `--max-body <size>` | Max upload size (e.g. 10m) | 10m | | `--load-balancing <method>` | round-robin, least-conn, ip-hash | round-robin | | `--websocket` | WebSocket upgrade headers | 0 | | `--output <file>` | Output file path | nginx.conf | | `--validate` | Run nginx -t after generation | 0 | | `--preset <name>` | Start from a template preset | - | ## Environment Variables | Variable | Description | Default | |---|---|---| | `PORT` | Web server port | 3000 | | `NODE_ENV` | development or production | development | | `NGINX_BINARY` | Path to nginx binary | nginx (from PATH) | | `CONFIG_TTL_MINUTES` | How long generated configs are held | 10 | | `ENABLE_VALIDATION` | Enable nginx -t validation | 1 | | `MAX_CONFIG_SIZE_KB` | Maximum generated config size | 512 | ## Available Presets | Preset | Description | |---|---| | `wordpress` | WordPress + PHP-FPM with permalink rewriting | | `nextjs` | Next.js with static asset caching | | `spa` | React/Vue/Angular SPA with HTML5 history routing | | `api-gateway` | Rate-limited REST API reverse proxy | | `static` | Static site with gzip and browser caching | | `laravel` | Laravel + PHP-FPM | | `django` | Django + Gunicorn via UNIX socket | | `go-app` | Go binary upstream with health checks | ## API (when running as a server) ``` POST /api/generate # Generate config from answers JSON POST /api/validate # Validate a config string GET /api/templates # List all presets GET /api/templates/:id/generate # Generate from preset GET /api/download/:id # Download a generated config file ``` ## Validation When nginx is available on PATH, `nginx -t` is used for validation. Otherwise, a structural validator checks: - Balanced braces - Required directives (`server`, `listen`, `server_name`) - No obviously invalid directive names To validate after generating: ```bash nginx-conf validate nginx.conf ``` Or validate any existing config: ```bash nginx-conf validate /etc/nginx/nginx.conf ``` ## Troubleshooting ### "nginx not found on PATH" The CLI uses a structural fallback validator. For full validation, install nginx: ```bash # Ubuntu/Debian apt install nginx # macOS brew install nginx ``` ### "directive X is not allowed in context" nginx directives are context-sensitive. Some directives only work in the http block, others in server or location. The generated configs use correct contexts. If you edited the config manually, check the nginx documentation for that directive. ### "worker_connections is below recommended" For production, set `worker_connections` to at least 1024 per worker. For high-traffic sites, 4096 or higher. The default is conservative for compatibility. ### Generated config fails nginx -t If the generated config fails validation, check: 1. SSL certificate and key paths exist on the server 2. Upstream server addresses are reachable 3. No conflicting server blocks with the same `listen` + `server_name` combination
Related Skills
Skill: Invoice Generator Core
## Purpose
password-generator
Use the password-generator app to generate secure passwords, passphrases, and PINs in the browser.
Skill: pi-config
Patterns for Raspberry Pi boot partition configuration injection.
dns-config
Manage the local-dns-override hosts.yaml configuration file. Use when you need to view the current DNS config, validate a hosts.yaml file before applying it, understand the config file format, or check which records are currently loaded. Triggers include "show DNS config", "validate hosts.yaml", "check loaded records", "DNS config file", "list local DNS entries", or any task involving viewing or validating the DNS record configuration.
validate-config
Validate a config file (JSON, YAML, TOML, or .env) against a JSON Schema using config-validator. Use when you need to check that a config file is valid before deploying, catch missing required fields or wrong types, or run validation in a CI pipeline. Triggers include "validate config", "check config file", "schema validation", "validate yaml", "validate json config", "config has errors", or any task involving checking whether a config file matches its expected schema.
ssh-config-manager
Manage SSH host configurations in ~/.ssh/config from the terminal. Use when adding, editing, or searching SSH hosts, cloning host configs, testing connections, or importing configs. Triggers include "ssh config", "ssh host", "sshm", "add ssh host", "edit ssh config", "test ssh connection".
qr-code-generator
Generate QR codes via the web UI or REST API. Supports URL, WiFi, vCard, and plain text. Outputs SVG and PNG. Includes logo embedding and bulk CSV generation.
expense-report-generator
Manage expenses and generate PDF reports using the expense-report-generator app.
Skill: Uptime Monitoring
## Overview
Skill: Status Page
## Overview
Skill: unit-conversion
## Overview
Skill: recipe-scaler
## Overview