nginx
Skill15 starsChanged 42 days agoMITView on GitHub
Expert Nginx web server assistance covering reverse proxying, load balancing, caching, SSL/TLS, and HTTP/2/3 configuration. Use when deploying high-concurrency web servers and API gateways.
10 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- Alteriom/ai-dev-skillstheir own version, first seen Oct 11, 2026
- jholhewres/devclaw-skillsedited, first seen Oct 9, 2026
- AvilaCarlosDev/openclaw-skillstheir own version, first seen Sep 19, 2026
- conjure-3301/skillstheir own version, first seen Aug 17, 2026
- weiweimhy/agent-skillstheir own version, first seen Jul 1, 2026
- TheDecipherist/claude-code-mastery-project-starter-kittheir own version, first seen Jun 26, 2026
Used with
Projects with it also use code-review.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
GoogleSkillcode-review
Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.
Also in 3 projects that use this
Other versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- jholhewres/devclaw-skills★ 415% same
- ffsshhttiikk/opencode-agents-skills★ 218% same
Wrote their own version · 8
- TheDecipherist/claude-code-mastery-project-starter-kit★ 337same name
- nejclovrencic/nginx-agent-skills★ 12same name
- tensorshift/claude-nginx-skill★ 3same name
- AvilaCarlosDev/openclaw-skills★ 1same name
- ElvitaStudio/vps-deploy-skills★ 1same name
- Alteriom/ai-dev-skills★ 0same name
- conjure-3301/skills★ 0same name
- weiweimhy/agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository350 other files it gives its agents.
- airflowSkill
- catboostSkill
- claudeSkill
- comfyuiSkill
- cursor-aiSkill
- dalleSkill
- daskSkill
- dbtSkill
- deepseekSkill
- fastaiSkill
- geminiSkill
- github-copilotSkill
- huggingfaceSkill
- jaxSkill
- jupyterSkill
- kerasSkill
- langchainSkill
- lightgbmSkill
- llamaindexSkill
- llamaSkill
- matplotlibSkill
- midjourneySkill
- mistralSkill
- mlflowSkill
- nltkSkill
- numpySkill
- ollamaSkill
- openai-gptSkill
- opencvSkill
- pandasSkill
- perplexitySkill
- plotlySkill
- polarsSkill
- pytorchSkill
- raySkill
- scikit-learnSkill
- seabornSkill
- spacySkill
- sparkSkill
- stable-diffusionSkill
- tensorflowSkill
- vaexSkill
- weights-biasesSkill
- whisperSkill
- xgboostSkill
- api-gatewaySkill
- clean-architectureSkill
- cqrsSkill
- domain-driven-designSkill
- event-drivenSkill
- event-sourcingSkill
- graphqlSkill
- grpcSkill
- hexagonalSkill
- microservicesSkill
- modular-monolithSkill
- monolithSkill
- rest-apiSkill
- sagaSkill
- serverlessSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 0 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 183
Always test configuration syntax with nginx -t before issuing nginx -s reload.
- Very specific: line 190
Use if directives inside location blocks (if is evil in Nginx).
- Very specific: line 191
Run worker processes as root.
“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Nginx
Nginx is a high-performance HTTP server, reverse proxy, and load balancer known for its asynchronous event-driven architecture and native HTTP/3 support.
When to Use
- High-Performance HTTP Reverse Proxy & Web Server: Serving millions of requests per second with an asynchronous event-driven architecture.
- SSL/TLS Termination & HTTP/2/HTTP/3: Offloading cryptographic handshakes and managing Let's Encrypt certificates.
- Upstream Load Balancing & Microservice Routing: Distributing traffic across backend clusters with keepalive connection pools.
- Rate Limiting & DDoS Defense: Enforcing token-bucket rate limits (
limit_req_zone) per IP address.
Quick Start
# nginx.conf
server {
listen 443 quic reuseport;
listen 443 ssl;
http2 on;
server_name example.com;
ssl_certificate cert.pem;
ssl_certificate_key key.pem;
location / {
proxy_pass http://localhost:3000;
add_header Alt-Svc 'h3=":443"; ma=86400';
}
}Core Concepts
Hardened Reverse Proxy Configuration with HTTP/2 and Upstream Keepalive
Production server configuration with security headers:
# /etc/nginx/nginx.conf
user nginx;
worker_processes auto;
worker_rlimit_nofile 65535;
events {
worker_connections 8192;
use epoll;
multi_accept on;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Performance optimizations
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# Rate limiting zone: 10MB memory, 50 requests/second per IP
limit_req_zone $binary_remote_addr zone=api_limit:10m rate=50r/s;
upstream backend_nodes {
server 10.0.1.10:8080 max_fails=3 fail_timeout=10s;
server 10.0.1.11:8080 max_fails=3 fail_timeout=10s;
keepalive 32; # Cache up to 32 idle connections to backends
}
server {
listen 443 ssl http2;
server_name api.example.com;
ssl_certificate /etc/letsencrypt/live/api.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/api.example.com/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256;
ssl_prefer_server_ciphers off;
# Security Headers
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
add_header X-Frame-Options "DENY" always;
add_header X-Content-Type-Options "nosniff" always;
location / {
limit_req zone=api_limit burst=20 nodelay;
proxy_pass http://backend_nodes;
proxy_http_version 1.1;
proxy_set_header Connection ""; # Required for upstream keepalive
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;
proxy_connect_timeout 5s;
proxy_read_timeout 60s;
}
}
}Static Asset Caching & Single Page Application Routing
Serving static SPAs with browser caching:
server {
listen 80;
server_name app.example.com;
root /var/www/app/dist;
index index.html;
# Immutable caching for hashed assets
location ~* \.(?:css|js|woff2?|png|jpg|webp)$ {
expires 1y;
add_header Cache-Control "public, max-age=31536000, immutable";
access_log off;
}
# SPA route fallback
location / {
try_files $uri $uri/ /index.html;
}
}Validating and Reloading Configuration
Testing syntax before reloading:
# Test configuration syntax
nginx -t
# Gracefully reload configuration without dropping connections
nginx -s reloadCommon Patterns
Hardened Reverse Proxy with SSL and Rate Limiting
Problem: Slow APIs and vulnerability to brute-force DDoS attacks on login endpoints.
Solution: Configure Nginx with connection limits and proxy buffering:
limit_req_zone $binary_remote_addr zone=api_limit:10m rate=10r/s;
server {
listen 443 ssl http2;
server_name api.example.com;
ssl_certificate /etc/letsencrypt/live/api.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/api.example.com/privkey.pem;
location / {
limit_req zone=api_limit 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 '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;
}
}Best Practices
Do:
- Always test configuration syntax with
nginx -tbefore issuingnginx -s reload. - Set
proxy_http_version 1.1andproxy_set_header Connection ""when usingupstreamkeepalive pools. - Enable
limit_req_zoneto protect login, payment, and search endpoints against abuse. - Enable
server_tokens off;to prevent revealing Nginx version information to attackers.
Don't:
- Use
ifdirectives insidelocationblocks (if is evilin Nginx); usetry_filesor maps. - Run worker processes as root; use unprivileged
nginxorwww-datasystem users. - Omit
Strict-Transport-Securityheaders on production HTTPS endpoints.
Troubleshooting
| Error | Cause | Solution |
502 Bad Gateway | Upstream backend server offline or port unreachable. | Verify upstream application is listening on specified port. |
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) | Another web server process already listening on port 80. | Find conflicting process: sudo lsof -i :80 and stop it. |
413 Request Entity Too Large | Client uploaded file larger than default client_max_body_size (1M). | Increase setting: client_max_body_size 50M; in http or server block. |
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

