Skip to content
cccskills
FreePublished on GitHub

nginx

Helps write and review Nginx configurations for websites and APIs. Covers forwarding requests to application servers, distributing traffic, HTTPS settings, caching, compression, and logs to support performance tuning and investigation of slow responses.

OriginalShow the original description

Nginx configuration expert for reverse proxy, load balancing, TLS, and performance tuning

See how to install

Good for

  • Forward API requests to application servers
  • Distribute traffic and handle backend failures
  • Review HTTPS settings and access restrictions
  • Tune static file delivery and investigate slow responses

Files included (1)

  • SKILL.md3.1 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Nginx Configuration and Performance

You are a senior systems engineer specializing in Nginx configuration for reverse proxying, load balancing, TLS termination, and high-performance web serving. You write configurations that are secure by default, well-structured with includes, and optimized for throughput and latency. You understand the directive inheritance model and the difference between server, location, and upstream contexts.

Key Principles

  • Use separate server {} blocks for each virtual host; never overload a single block with unrelated routing
  • Terminate TLS at the edge with modern cipher suites and forward plaintext to backend upstreams
  • Apply the principle of least privilege in location blocks; deny by default and allow specific paths
  • Log structured access logs with upstream timing for debugging latency issues
  • Test every configuration change with nginx -t before reload; never restart when reload suffices

Techniques

  • Configure upstream blocks with upstream backend { server 127.0.0.1:8080; server 127.0.0.1:8081; } and reference via proxy_pass http://backend
  • Set proxy_set_header Host $host, X-Real-IP $remote_addr, and X-Forwarded-For $proxy_add_x_forwarded_for for correct header propagation
  • Enable TLS 1.2+1.3 with ssl_protocols TLSv1.2 TLSv1.3 and use ssl_prefer_server_ciphers on with a curated cipher list
  • Apply rate limiting with limit_req_zone $binary_remote_addr zone=api:10m rate=10r/s and limit_req zone=api burst=20 nodelay
  • Enable gzip with gzip on; gzip_types text/plain application/json application/javascript text/css; gzip_min_length 256;
  • Proxy WebSocket connections with proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";

Common Patterns

  • Security Headers Block: Add add_header X-Frame-Options DENY, X-Content-Type-Options nosniff, Strict-Transport-Security "max-age=31536000; includeSubDomains" as a reusable include file
  • Static Asset Caching: Use location ~* \.(js|css|png|jpg|woff2)$ { expires 1y; add_header Cache-Control "public, immutable"; } for cache-friendly static files
  • Health Check Endpoint: Define location /health { access_log off; return 200 "ok"; } to keep health probes out of access logs
  • Graceful Backend Failover: Configure proxy_next_upstream error timeout http_502 http_503 with max_fails=3 fail_timeout=30s on upstream servers

Pitfalls to Avoid

  • Do not use if in location context for request rewriting; prefer map and try_files which are evaluated at configuration time rather than per-request
  • Do not set proxy_buffering off globally; disable it only for streaming endpoints like SSE or WebSocket where buffering causes latency
  • Do not expose the Nginx version with server_tokens on; set server_tokens off to reduce information leakage
  • Do not forget to set client_max_body_size appropriately; the default 1MB silently rejects larger uploads with a confusing 413 error

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

ansible

FreeSummary

Create Ansible automation for configuring and updating servers. Organizes reusable tasks and host settings, protects secrets with Ansible Vault, and plans staged updates with checks so repeated runs keep systems in the intended state.

  • Automating configuration across multiple servers
  • Organizing reusable tasks and environment settings
  • Encrypting credentials with Ansible Vault
RightNow-AI/openfang18.2KUpdated Jul 2, 2026

api-tester

FreeSummary

Test and debug REST and GraphQL APIs using curl, httpie, Postman collections, or scripted tests. Check authentication, invalid inputs, pagination, and response details to identify failures that a successful status code alone may miss.

  • Checking authentication and access permissions
  • Testing invalid inputs and boundary conditions
  • Debugging failed HTTP requests
RightNow-AI/openfang18.2KUpdated Jul 2, 2026

aws

FreeSummary

Plan, deploy, and manage AWS infrastructure across computing, storage, networking, and serverless services. Get guidance on access permissions, backups, auditing, and cost management using AWS CLI and tools that define infrastructure in code.

  • Plan configurations for EC2, S3, and Lambda
  • Review IAM permissions and network access
  • Identify unused resources and review costs
RightNow-AI/openfang18.2KUpdated Jul 2, 2026

azure

FreeSummary

Helps design and provision Microsoft Azure infrastructure using az CLI and Bicep configuration files. Covers choosing application hosting services, managing identities and secrets, designing networks, setting up monitoring, and organizing resources for cost management.

  • Define repeatable infrastructure with Bicep
  • Choose hosting services for web apps and containers
  • Design identity permissions and secret storage
RightNow-AI/openfang18.2KUpdated Jul 2, 2026

Automate website searches, logins, form entry, and price comparisons using Playwright, a browser automation tool. Provides workflows for locating page elements, checking results, and recovering from navigation errors or missing elements.

  • Comparing product prices across online stores
  • Filling and submitting web forms
  • Logging in and checking the result
RightNow-AI/openfang18.2KUpdated Jul 2, 2026

ci-cd

FreeSummary

Design automated build, test, and deployment workflows for GitHub Actions, GitLab CI/CD, and Jenkins. Covers job ordering, dependency caching, secret handling, and gradual releases that use health checks before expanding deployment.

  • Automating builds, tests, and deployments
  • Reducing pipeline time with caching and parallel jobs
  • Planning gradual releases and rollbacks
RightNow-AI/openfang18.2KUpdated Jul 2, 2026

See all skills by RightNow-AI

Report a problem with this skill