Nginx Configuration

aj-geddes/useful-ai-prompts/skills/nginx-configuration

by aj-geddes3f5182cfd739No license355 starsListed Oct 8, 2026Updated Oct 8, 2026Repository updated 7 months ago

Configure Nginx web server for high-performance reverse proxy, load balancing, SSL/TLS, caching, and API gateway functionality.

Includes scriptsDevOps & Cloud
AI-generated overview

Guides configuring Nginx for reverse proxy, load balancing, SSL/TLS, caching and API gateway use.

What it does
Provides reference guidance and examples for production Nginx configuration, covering reverse proxy setup, load balancing, SSL/TLS termination, caching, compression, rate limiting and API gateway patterns. It ships reference documents, a validation script and an API scaffold template. Output is configuration guidance and example configuration rather than a running deployment.
When to use it
Use when setting up or tuning an Nginx server, such as reverse proxying backend services, terminating TLS, balancing load, adding caching or exposing an API gateway. Also relevant when hardening or monitoring an existing Nginx setup.
Requirements
An Nginx installation to apply configurations to; the skill ships an executable validation script and a template file. No credentials or network access are stated.

Nginx Configuration

Table of Contents

Overview

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:

nginx
# /etc/nginx/nginx.confuser 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:

GuideContents
Production Nginx Configuration [blocked]Production Nginx Configuration
HTTPS Server with Load Balancing [blocked]HTTPS Server with Load Balancing
Nginx Configuration Script [blocked]Nginx Configuration Script
Nginx Monitoring Configuration [blocked]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

Source and attribution

Source:aj-geddes/useful-ai-promptsinskills/nginx-configurationat commit3f5182c

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal

Nginx Configuration · skills/nginx-configuration Agent Skill | SourceWeft