nginx
БесплатноБез исполняемых скриптовНе проверенAssists with configuring Nginx as a web server, reverse proxy, and load balancer. Use when serving static files, proxying to application servers, setting up…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Nginx
Overview
Nginx is a high-performance web server and reverse proxy that serves static files, proxies requests to application servers, load balances across backends, terminates TLS, and caches responses. It handles thousands of concurrent connections with minimal resource usage through an event-driven, non-blocking architecture.
Instructions
- When configuring server blocks, define virtual hosts with
server_namefor domain matching andlistenfor ports, using separate blocks for HTTP (port 80, redirect to HTTPS) and HTTPS (listen 443 ssl;plushttp2 on;). Since nginx 1.25.1 thehttp2parameter oflistenis deprecated andnginx -twarns about it. - When setting up reverse proxying, use
proxy_passto forward to upstream servers and setproxy_set_headerfor Host, X-Real-IP, X-Forwarded-For, and X-Forwarded-Proto to preserve client information. - When load balancing, define
upstreamblocks with multiple servers and choose the strategy: round-robin (default),least_conn,ip_hashto keep a client on the same backend by IP address, or weighted distribution. - When configuring TLS, set modern protocols (
TLSv1.2 TLSv1.3), enable a shared session cache, and get certificates from Let's Encrypt via certbot or another ACME client. Do not addssl_staplingfor Let's Encrypt certificates: Let's Encrypt ended OCSP service on 2025-08-06, and its certificates carry no OCSP URL. Use it only if your CA still issues OCSP responses (and then also setssl_trusted_certificate). - When serving static files, enable
gzipcompression for text-based content, setexpires 1yfor hashed assets, usesendfile onfor efficient transfer, andtry_files $uri $uri/ /index.html;for SPA fallback routing. - When a backend uses WebSockets, send
proxy_http_version 1.1;withUpgradeandConnectionheaders (see the example below). - When adding security, set headers (X-Frame-Options, X-Content-Type-Options, HSTS, CSP) and configure rate limiting with
limit_req_zoneto prevent abuse.
sudo nginx -t && sudo systemctl reload nginx # test, then reload without dropping connections
Examples
Example 1: Set up Nginx as reverse proxy with TLS for a Node.js app
User request: "Configure Nginx with HTTPS to proxy to my Node.js API on port 3000"
Actions:
- Create a server block listening on port 443 with SSL certificate paths and HTTP/2
- Configure
proxy_pass http://localhost:3000with proper header forwarding - Add a port 80 server block that redirects all HTTP to HTTPS
- Enable TLS 1.2/1.3, session caching, and HSTS
# /etc/nginx/conf.d/api.shopline.dev.conf (tested with nginx -t on 1.31.8)
limit_req_zone $binary_remote_addr zone=api:10m rate=10r/s;
map $http_upgrade $connection_upgrade { default upgrade; '' close; }
server { # unknown hostnames get no certificate
listen 80 default_server;
listen 443 ssl default_server;
ssl_reject_handshake on;
return 444;
}
server {
listen 80;
server_name api.shopline.dev;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
http2 on;
server_name api.shopline.dev;
ssl_certificate /etc/letsencrypt/live/api.shopline.dev/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/api.shopline.dev/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 1d;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Content-Type-Options "nosniff" always;
location / {
limit_req zone=api burst=20 nodelay;
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
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;
}
}
The agent then runs nginx -t and reloads only if it reports test is successful.
Output: An Nginx configuration with TLS termination, HTTP-to-HTTPS redirect, and reverse proxy to the Node.js app.
Example 2: Configure load balancing with health checks
User request: "Load balance across three API servers with failover"
Actions:
- Define an
upstreamblock with three backend servers andleast_connstrategy - Set
max_fails=3 fail_timeout=30s: this is passive health checking (a server is skipped after failed real requests); active probes are an NGINX Plus feature - Add a
backupserver that activates only when primary servers are down - Enable upstream keepalive connections to reduce connection setup to the backends
upstream api_backend {
least_conn;
server 10.0.1.11:3000 max_fails=3 fail_timeout=30s;
server 10.0.1.12:3000 max_fails=3 fail_timeout=30s;
server 10.0.1.13:3000 backup;
keepalive 16;
}
# in the location: proxy_pass http://api_backend; proxy_http_v
Установить nginx в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл nginx?
Assists with configuring Nginx as a web server, reverse proxy, and load balancer. Use when serving static files, proxying to application servers, setting up TLS termination, configuring caching, rate limiting, or writing security headers. Trigger words: nginx, reverse proxy, load balancer, tls, ssl, server block, location block.
Как установить скилл nginx?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл nginx запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic