Automated summary
Configures and troubleshoots Nginx for reverse proxy, TLS, caching, compression, rate limiting, and load balancing.
Strengths
- Maps HTTP status codes (502, 504, 413, 499, TLS failures) to likely causes and concrete checks.
- Enforces `nginx -t` before every reload and asks for confirmation before sensitive changes.
- Covers common reverse-proxy and TLS pitfalls such as missing `X-Forwarded-Proto`, misplaced `client_max_body_size`, incomplete certificate chains, and real client IPs behind proxies.
- Explains how to use `nginx -T` to inspect the effective configuration with all includes resolved.
Limitations
- Will not reload or edit configuration without explicit confirmation and a passing `nginx -t`.
- Does not issue or renew certificates; it only provides the procedure.
- Declines changes that would broaden the service's exposure.
Use it to design, fix, or diagnose an Nginx configuration, especially for reverse proxy or TLS setups.
Avoid it for certificate issuance or renewal, or for general system administration outside Nginx.
Security analysis
CautionThe skill uses powerful system tools for legitimate nginx configuration and diagnosis. It explicitly mandates nginx -t before any reload and requires confirmation for reload and config edits, reducing risk. No destructive or exfiltrating actions are present. The use of service-control commands warrants caution.
- •Instructs nginx -s reload, a service-affecting command; mitigation (nginx -t first and user confirmation) is specified, but still requires care.
- •Uses system commands (nginx -t, nginx -T, openssl s_client) without declaring allowed-tools, which may lead to ambiguous execution permissions or unexpected tool prompts.
Examples
My app behind Nginx returns 502 Bad Gateway after a deploy. Check the upstream config and tell me what to verify before reloading.Set up an Nginx reverse proxy for app.example.com with TLS 1.2/1.3, HTTP/2, and the correct X-Forwarded-Proto headers.I configured client_max_body_size in a location block but uploads still fail with 413. Show the effective Nginx config and fix it.name: nginx-expert description: > Configuração e diagnóstico de Nginx — reverse proxy, TLS, HTTP/2, HTTP/3, cache, compressão, rate limit e load balancing. Use quando o usuário disser "nginx", "reverse proxy", "502", "504", "certificado", "SSL", "TLS", "rate limit", "cache", "upstream". metadata: { version: 1.0.0 }
Nginx Expert
Você configura a porta de entrada. Um erro aqui derruba tudo que está atrás.
Portão de segurança
nginx -t e leitura de config rodam livres.
nginx -s reload e edição de config exigem confirmação.
Sempre
nginx -tantes de qualquer reload. Reload com config inválida derruba o serviço inteiro. Não há exceção a esta regra.
Diagnóstico por código
| Código | Causa provável | Verificar |
|---|---|---|
| 502 | upstream morto ou recusando | app viva? porta certa? SG? |
| 504 | upstream lento demais | proxy_read_timeout vs. tempo real da app |
| 413 | corpo maior que o limite | client_max_body_size |
| 499 | cliente desistiu antes | app lenta — o problema é upstream |
| 404 inesperado | root/alias ou ordem de location | nginx -T mostra a config efetiva |
| TLS falha | cadeia incompleta, certificado expirado | openssl s_client -connect host:443 |
nginx -T (maiúsculo) despeja a configuração efetiva, com todos os
includes resolvidos. É o comando que resolve "mas eu configurei isso".
Reverse proxy — base
location / {
proxy_pass http://backend;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; # sem isto, app gera URL http
proxy_read_timeout 60s;
}
Esquecer X-Forwarded-Proto atrás de ALB é a causa clássica de loop de
redirecionamento e link http em página https.
Rate limit
limit_req_zone $binary_remote_addr zone=api:10m rate=10r/s;
location /api/ { limit_req zone=api burst=20 nodelay; }
Atrás de proxy, $binary_remote_addr é o IP do proxy — configure
real_ip_header antes, ou você limita o proxy inteiro.
TLS
- TLS 1.2 e 1.3 apenas
ssl_certificatecom a cadeia completa (fullchain), não só o certificado- HSTS depois de confirmar que todo o tráfego é https
- OCSP stapling quando disponível
Anti-padrões
- Reload sem
nginx -t client_max_body_sizesó nolocationquando o erro vem doserver- Log de acesso desligado em produção
- Cadeia incompleta — funciona no navegador, falha em cliente de API
Limites
- Não faz reload sem
nginx -tpassar e sem confirmação - Não emite nem renova certificado — entrega o procedimento
- Não altera regra que amplie exposição
Skills relacionadas
linux-sysadmin · laravel-platform · devsecops · performance-engineer
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/nginx-expert-ms47vr7g/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/nginx-expert-ms47vr7g' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/nginx-expert-ms47vr7g/download' --output '.skill-downloads/nginx-expert-ms47vr7g/SKILL.md.part' && mv '.skill-downloads/nginx-expert-ms47vr7g/SKILL.md.part' '.skill-downloads/nginx-expert-ms47vr7g/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/nginx-expert-ms47vr7g/SKILL.md' && test -s '.skill-downloads/nginx-expert-ms47vr7g/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/nginx-expert' && cp -R '.skill-downloads/nginx-expert-ms47vr7g' '.claude/skills/nginx-expert'Cursor
test -f '.skill-downloads/nginx-expert-ms47vr7g/SKILL.md' && test -s '.skill-downloads/nginx-expert-ms47vr7g/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/nginx-expert' && cp -R '.skill-downloads/nginx-expert-ms47vr7g' '.cursor/skills/nginx-expert'Codex
test -f '.skill-downloads/nginx-expert-ms47vr7g/SKILL.md' && test -s '.skill-downloads/nginx-expert-ms47vr7g/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/nginx-expert' && cp -R '.skill-downloads/nginx-expert-ms47vr7g' '.agents/skills/nginx-expert'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/nginx-expert-ms47vr7g'openskills read 'nginx-expert-ms47vr7g'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/nginx-expert-ms47vr7g/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
Configure a Chat Channel with SecretRefs
DevOps
Set up chat channels using non-interactive commands, with secrets only as SecretRefs. Covers gather, mutate, repair, and prove steps for reliable delivery.
Investigate ClickHouse CI Failures
DevOps
Investigate a ClickHouse CI failure end-to-end from a PR or S3 report URL. Fetches failed tests, classifies flaky vs real regression, and checks for existing issues/fixes.
Ansible PR Review
DevOps
Reviews an Ansible PR following the project's standardized process, including changelog checks, test coverage validation, and feedback tracking.