nginx

Installation
SKILL.md

Nginx

Overview

Nginx is a high-performance web server and reverse proxy that serves static files, proxies requests to application servers, load balances across backends, terminates TLS, and caches responses. It handles thousands of concurrent connections with minimal resource usage through an event-driven, non-blocking architecture.

Instructions

  • When configuring server blocks, define virtual hosts with server_name for domain matching and listen for ports, using separate blocks for HTTP (port 80, redirect to HTTPS) and HTTPS (port 443 with SSL and HTTP/2).
  • When setting up reverse proxying, use proxy_pass to forward to upstream servers and set proxy_set_header for Host, X-Real-IP, X-Forwarded-For, and X-Forwarded-Proto to preserve client information.
  • When load balancing, define upstream blocks with multiple servers and choose the strategy: round-robin (default), least_conn, ip_hash for sticky sessions, or weighted distribution.
  • When configuring TLS, set modern protocols (TLSv1.2 TLSv1.3), enable ssl_stapling and session caching, and integrate with Let's Encrypt via certbot for automatic certificate renewal.
  • When serving static files, enable gzip compression for text-based content, set expires 1y for hashed assets, use sendfile on for efficient transfer, and try_files for SPA fallback routing.
  • When adding security, set headers (X-Frame-Options, X-Content-Type-Options, HSTS, CSP) and configure rate limiting with limit_req_zone to prevent abuse.

Examples

Example 1: Set up Nginx as reverse proxy with TLS for a Node.js app

Installs
2
GitHub Stars
128
First Seen
Jun 5, 2026
nginx — terminalskills/skills