Pular para o conteúdo
Skillpedia
Deploy e nuvem (DevOps)18 mil · #10693

nginx

O que ela faz

Esta skill orienta a escrita e a revisão de configurações do Nginx para servir sites, proxies reversos, balanceamento de carga e TLS. É para administradores de sistemas e desenvolvedores que rodam o Nginx na frente dos seus apps.

Quando usar

  • ✓Quando você precisa que o Nginx encaminhe o tráfego para um app que roda em outra porta.
  • ✓Quando você quer HTTPS configurado com ajustes modernos no Nginx.
  • ✓Quando você precisa distribuir o tráfego entre vários servidores de back-end.

Link da skill

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

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/nginx/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Configure o Nginx para servir o meu app por HTTPS e encaminhar as requisições para dois servidores de back-end.”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

A skill oferece padrões seguros, blocos de servidor separados, grupos upstream para balanceamento de carga e configurações de cabeçalhos, e recomenda testar com uma checagem de configuração antes de recarregar.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do GitHub.

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

  • Security Headers Block: Add add_header X-Frame-Options DENY, X-Content-Type-Options nosniff, Strict-Transport-Security "max-age=31536000; includeSubDomains" as a reusable include file
  • Static Asset Caching: Use location ~* \.(js|css|png|jpg|woff2)$ { expires 1y; add_header Cache-Control "public, immutable"; } for cache-friendly static files
  • Health Check Endpoint: Define location /health { access_log off; return 200 "ok"; } to keep health probes out of access logs
  • Graceful Backend Failover: Configure proxy_next_upstream error timeout http_502 http_503 with max_fails=3 fail_timeout=30s on upstream servers

Pitfalls to Avoid

  • Do not use if in location context for request rewriting; prefer map and try_files which are evaluated at configuration time rather than per-request
  • Do not set proxy_buffering off globally; disable it only for streaming endpoints like SSE or WebSocket where buffering causes latency
  • Do not expose the Nginx version with server_tokens on; set server_tokens off to reduce information leakage
  • Do not forget to set client_max_body_size appropriately; the default 1MB silently rejects larger uploads with a confusing 413 error
Perguntas frequentes

Por que testar antes de recarregar?

A skill recomenda rodar um teste de configuração primeiro, para que um erro não derrube o site.

Quais versões de TLS são permitidas?

A skill configura o TLS 1.2 e o 1.3, com uma lista de cifras selecionada.

Quais cabeçalhos são repassados ao back-end?

A skill define o host, o IP real do cliente e a cadeia de encaminhamento, para que o app veja os detalhes corretos da requisição.

Detalhes

Descrição original do autor

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

repo: RightNow-AI/openfang

Popularidade

Estrelas no GitHub
18 mil
Posição no ranking
#10693
Licença
Apache-2.0
Atualizada em
02/07/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas