Skip to content
nginx-configuration logo

Nginx Configuration

nginx-configuration

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

aj-geddes/useful-ai-prompts1.4Kinstalls351stars

SKILL.md

Full skill instructions

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:

# /​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:

GuideContents
Production Nginx ConfigurationProduction Nginx Configuration
HTTPS Server with Load BalancingHTTPS Server with Load Balancing
Nginx Configuration ScriptNginx Configuration Script
Nginx Monitoring ConfigurationNginx 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

More skills from aj-geddes

jenkins-pipeline logo
aj-geddes/useful-ai-prompts

jenkins-pipeline

Build Jenkins declarative and scripted pipelines with stages, agents, parameters, and plugins. Implement multi-branch pipelines and deployment automation.

351 1.8K
View
ansible-automation logo
aj-geddes/useful-ai-prompts

ansible-automation

Infrastructure automation and configuration management using Ansible playbooks, roles, and inventory. Use for deploying applications, patching, and managing servers.

351 1.7K
View
ios-swift-development logo
aj-geddes/useful-ai-prompts

ios-swift-development

Develop native iOS apps with Swift. Covers MVVM architecture, SwiftUI, URLSession for networking, Combine for reactive programming, and Core Data persistence.

351 1.5K
View
android-kotlin-development logo
aj-geddes/useful-ai-prompts

android-kotlin-development

Develop native Android apps with Kotlin. Covers MVVM with Jetpack, Compose for modern UI, Retrofit for API calls, Room for local storage, and navigation architecture.

351 1.5K
View
wireframe-prototyping logo
aj-geddes/useful-ai-prompts

wireframe-prototyping

Create wireframes and interactive prototypes to visualize user interfaces and gather feedback early. Use tools and techniques to communicate design ideas before development.

351 1.4K
View
flask-api-development logo
aj-geddes/useful-ai-prompts

flask-api-development

Develop lightweight Flask APIs with routing, blueprints, database integration, authentication, and request/response handling. Use when building RESTful APIs, microservices, or lightweight web services with Flask.

351 1.4K
View
markdown-documentation logo
aj-geddes/useful-ai-prompts

markdown-documentation

Master markdown formatting, GitHub Flavored Markdown, README files, and documentation formatting. Use when writing markdown docs, READMEs, or formatting documentation.

351 1.3K
View
css-architecture logo
aj-geddes/useful-ai-prompts

css-architecture

Organize CSS using BEM, SMACSS, and CSS-in-JS patterns. Use when building scalable, maintainable styling systems with proper naming conventions.

351 712
View
penetration-testing logo
aj-geddes/useful-ai-prompts

penetration-testing

Ethical hacking and security testing methodologies using penetration testing tools, exploit frameworks, and manual security validation. Use when assessing application security posture and identifying exploitable vulnerabilities.

351 712
View
event-sourcing logo
aj-geddes/useful-ai-prompts

event-sourcing

Implement event sourcing and CQRS patterns using event stores, aggregates, and projections. Use when building audit trails, temporal queries, or systems requiring full history.

351 711
View
responsive-web-design logo
aj-geddes/useful-ai-prompts

responsive-web-design

Create responsive layouts using CSS Grid, Flexbox, media queries, and mobile-first design. Use when building adaptive interfaces that work across all devices.

351 699
View
api-contract-testing logo
aj-geddes/useful-ai-prompts

api-contract-testing

Verify API contracts between services to ensure compatibility and prevent breaking changes. Use for contract testing, Pact, API contract validation, schema validation, and consumer-driven contracts.

351 671
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View