configure-nginx-reverse-proxy
Configure Nginx for reverse proxy, load balancing, SSL termination, and high-performance static serving.
by rondoflow★ 37 GitHub stars
Install configure-nginx-reverse-proxy in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
When to Use
User needs Nginx expertise — from basic server blocks to production configurations. Agent handles reverse proxy, SSL, caching, and performance tuning.
Quick Reference
| Topic | File |
|---|---|
| Reverse proxy patterns | proxy.md |
| SSL/TLS configuration | ssl.md |
| Performance tuning | performance.md |
| Common configurations | examples.md |
Location Matching
- Exact
=first, then^~prefix, then regex~/~*, then longest prefix location /apimatches/api,/api/,/api/anything— prefix matchlocation = /apionly matches exactly/api— not/api/location ~ \.php$is regex, case-sensitive —~*for case-insensitive^~stops regex search if prefix matches — use for static files
proxy_pass Trailing Slash
proxy_pass http://backendpreserves location path —/api/users→/api/usersproxy_pass http://backend/replaces location path —/api/users→/users- Common mistake: missing slash = double path — or unexpected routing
- Test with
curl -vto see actual backend request
try_files
try_files $uri $uri/ /index.htmlfor SPA — checks file, then dir, then fallback- Last argument is internal redirect — or
=404for error $uri/tries directory with index — setindex index.html- Don't use for proxied locations — use
proxy_passdirectly
Proxy Headers
proxy_set_header Host $host— backend sees original host, not proxy IPproxy_set_header X-Real-IP $remote_addr— client IP, not proxyproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for— append to chainproxy_set_header X-Forwarded-Proto $scheme— for HTTPS detection
Upstream
- Define servers in
upstreamblock —upstream backend { server 127.0.0.1:3000; } proxy_pass http://backenduses upstream — load balancing included- Health checks with
max_failsandfail_timeout— marks server unavailable keepalive 32for connection pooling — reduces connection overhead
SSL/TLS
ssl_certificateis full chain — cert + intermediates, not just certssl_certificate_keyis private key — keep permissions restrictedssl_protocols TLSv1.2 TLSv1.3— disable older protocolsssl_prefer_server_ciphers on— server chooses cipher, not client
Common Mistakes
nginx -tbeforenginx -s reload— test config first- Missing semicolon — syntax error, vague message
rootinsidelocation— prefer inserver, override only when neededaliasvsroot— alias replaces location, root appends location- Variables in
if— many things break inside if, avoid complex logic
Variables
$uriis decoded, normalized path —/foo%20barbecomes/foo bar$request_uriis original with query string — unchanged from client$argsis query string —$arg_namefor specific parameter$hostfrom Host header —$server_namefrom config
Performance
worker_processes auto— matches CPU coresworker_connections 1024— per worker, multiply by workers for maxsendfile on— kernel-level file transfergzip ononly for text —gzip_types text/plain application/json ...gzip_min_length 1000— small files not worth compressing
Logging
access_log offfor static assets — reduces I/O- Custom log format with
log_format— add response time, upstream time error_loglevel:debug,info,warn,error— debug is verbose- Conditional logging with
mapandif— skip health checks
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
- manifest.json
FAQ
What does the configure-nginx-reverse-proxy skill do?
Configure Nginx for reverse proxy, load balancing, SSL termination, and high-performance static serving.
How do I install the configure-nginx-reverse-proxy skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the configure-nginx-reverse-proxy skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop 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…
internal-comms
AnthropicA 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…
skill-development
AnthropicThis 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…