PluginBench
Skill
Review
Audit score 70

nginx-configuration

aj-geddes/useful-ai-prompts

Configure Nginx for reverse proxy, load balancing, SSL/TLS, caching, and API gateway functionality.

What is nginx-configuration?

This skill provides production-grade Nginx configuration patterns for reverse proxying, load balancing, SSL termination, caching, and API gateway setups. Use it when you need to deploy or optimize Nginx for high-performance web server scenarios.

  • Configure reverse proxy and load balancing between backend services
  • Set up SSL/TLS termination with strong cipher suites
  • Implement HTTP/2, gRPC, and compression support
  • Configure caching strategies and rate limiting
  • Add security headers and DDoS protection
  • Perform URL rewriting and advanced routing

How to install nginx-configuration

npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill nginx-configuration
Claude Code
Cursor
Windsurf
Cline

How to use nginx-configuration

  1. 1.Review the Quick Start minimal configuration example for basic structure
  2. 2.Select relevant reference guides from the references/ directory based on your use case (production setup, HTTPS with load balancing, monitoring)
  3. 3.Customize the configuration for your backend services, SSL certificates, and performance requirements
  4. 4.Apply the DO/DON'T best practices checklist to your configuration
  5. 5.Deploy and test with your specific upstream services and traffic patterns

Use cases

Good for
  • Setting up a reverse proxy in front of multiple backend microservices
  • Implementing SSL/TLS termination for HTTPS traffic
  • Load balancing requests across multiple application servers
  • Configuring an API gateway with rate limiting and authentication
  • Optimizing static asset delivery with caching and compression
Who it's for
  • DevOps engineers
  • Backend infrastructure teams
  • System administrators
  • Site reliability engineers
  • Full-stack developers deploying production systems

nginx-configuration FAQ

What are the key performance tuning parameters?

Use worker_processes auto, set worker_rlimit_nofile to 65535, enable epoll, configure worker_connections based on expected load, and use least_conn load balancing with upstream connection pooling.

How do I set up SSL/TLS correctly?

Enable SSL/TLS with strong ciphers, use HTTP/2 for performance, implement proper certificate management, and redirect HTTP to HTTPS without caching authenticated responses.

What caching strategy should I use?

Implement proper cache headers, avoid caching authenticated responses or sensitive user data, use appropriate cache expiration times, and monitor cache hit rates.

How do I prevent abuse and DDoS attacks?

Implement rate limiting, configure upstream health checks, use security headers, and monitor with stub_status or Prometheus to detect anomalies.

Full instructions (SKILL.md)

Source of truth, from aj-geddes/useful-ai-prompts.


name: nginx-configuration description: > Configure Nginx web server for high-performance reverse proxy, load balancing, SSL/TLS, caching, and API gateway functionality.

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