Master Nginx configuration for production-grade web servers, reverse proxies, load balancing, SSL termination, caching, and API gateway patterns with advanced performance tuning.
When to Use
Reverse proxy setup
Load balancing between backend services
SSL/TLS termination
HTTP/2 and gRPC support
Caching and compression
Rate limiting and DDoS protection
URL rewriting and routing
API gateway functionality
Quick Start
Minimal working example:
# /etc/nginx/nginx.conf
user nginx;
worker_processes auto;
worker_rlimit_nofile 65535;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 4096;
use epoll;
multi_accept on;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Logging
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
log_format upstream_time '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" '
// ... (see reference guides for full implementation)
Reference Guides
Detailed implementations in the references/ directory:
Guide
Contents
Production Nginx Configuration
Production Nginx Configuration
HTTPS Server with Load Balancing
HTTPS Server with Load Balancing
Nginx Configuration Script
Nginx Configuration Script
Nginx Monitoring Configuration
Nginx Monitoring Configuration
Best Practices
✅ DO
Use HTTP/2 for performance
Enable SSL/TLS with strong ciphers
Implement proper caching strategies
Use upstream connection pooling
Monitor with stub_status or prometheus
Rate limit to prevent abuse
Add security headers
Use least_conn load balancing
Keep error logs separate from access logs
❌ DON'T
Disable gzip compression
Use weak SSL ciphers
Cache authenticated responses
Allow direct access to backends
Ignore upstream health checks
Mix HTTP and HTTPS without redirect
Use default error pages in production
Cache sensitive user data
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: aj-geddes-useful-ai-prompts-nginx-configuration3description: Nginx Configuration4---56# Nginx Configuration78## Table of Contents910- [Overview](#overview)11- [When to Use](#when-to-use)12- [Quick Start](#quick-start)13- [Reference Guides](#reference-guides)14- [Best Practices](#best-practices)1516## Overview1718Master Nginx configuration for production-grade web servers, reverse proxies, load balancing, SSL termination, caching, and API gateway patterns with advanced performance tuning.1920## When to Use2122- Reverse proxy setup23- Load balancing between backend services24- SSL/TLS termination25- HTTP/2 and gRPC support26- Caching and compression27- Rate limiting and DDoS protection28- URL rewriting and routing29- API gateway functionality3031## Quick Start3233Minimal working example:3435```nginx36# /etc/nginx/nginx.conf37user nginx;38worker_processes auto;39worker_rlimit_nofile 65535;40error_log /var/log/nginx/error.log warn;41pid /var/run/nginx.pid;4243events {44 worker_connections 4096;45 use epoll;46 multi_accept on;47}4849http {50 include /etc/nginx/mime.types;51 default_type application/octet-stream;5253 # Logging54 log_format main '$remote_addr - $remote_user [$time_local] "$request" '55 '$status $body_bytes_sent "$http_referer" '56 '"$http_user_agent" "$http_x_forwarded_for"';5758 log_format upstream_time '$remote_addr - $remote_user [$time_local] '59 '"$request" $status $body_bytes_sent '60 '"$http_referer" "$http_user_agent" '61// ... (see reference guides for full implementation)62```6364## Reference Guides6566Detailed implementations in the `references/` directory:6768| Guide | Contents |69|---|---|70| [Production Nginx Configuration](references/production-nginx-configuration.md) | Production Nginx Configuration |71| [HTTPS Server with Load Balancing](references/https-server-with-load-balancing.md) | HTTPS Server with Load Balancing |72| [Nginx Configuration Script](references/nginx-configuration-script.md) | Nginx Configuration Script |73| [Nginx Monitoring Configuration](references/nginx-monitoring-configuration.md) | Nginx Monitoring Configuration |7475## Best Practices7677### ✅ DO7879- Use HTTP/2 for performance80- Enable SSL/TLS with strong ciphers81- Implement proper caching strategies82- Use upstream connection pooling83- Monitor with stub_status or prometheus84- Rate limit to prevent abuse85- Add security headers86- Use least_conn load balancing87- Keep error logs separate from access logs8889### ❌ DON'T9091- Disable gzip compression92- Use weak SSL ciphers93- Cache authenticated responses94- Allow direct access to backends95- Ignore upstream health checks96- Mix HTTP and HTTPS without redirect97- Use default error pages in production98- Cache sensitive user data99100---101> Converted and distributed by [TomeVault](https://tomevault.io/claim/aj-geddes) — claim your Tome and manage your conversions.102<!-- tomevault:4.0:skill_md:2026-04-11 -->
Run npx skillmds@latest add tomevault-io/aj-geddes-useful-ai-prompts-nginx-configuration in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Nginx Configuration It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.