NGINX AI Prompts
42 free, production-ready NGINX AI prompts — copy-paste ready for ChatGPT, Claude, or Cursor. Every prompt ships with fill-in placeholders, a worked example, and production-safety notes, so you get a usable answer on the first try.
- NGINX Advanced
NGINX Canary & Blue-Green Routing Prompt
Design percentage-based canary and blue-green traffic routing in NGINX using split_clients and upstream weighting — with a sticky cohort, an instant rollback path, and a way to force yourself onto the canary for testing.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Advanced
NGINX CORS & Preflight Proxy Prompt
Get correct, secure CORS handling in NGINX for a reverse-proxied API — OPTIONS preflight, Access-Control-* headers, credentials, and per-origin allow-listing — without the classic duplicate-header and wildcard-with-credentials footguns.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Intermediate
NGINX Custom Error Pages & Fallback Prompt
Design clean custom error pages and graceful fallbacks in NGINX — branded 404/50x pages, an upstream-down maintenance page, and error interception that doesn't leak backend errors or break API JSON responses.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Advanced
NGINX GeoIP2 Country Access Control Prompt
Add country- or ASN-based access control and routing to NGINX with the ngx_http_geoip2 module — allow/deny by country, route regional traffic, and set headers — while correctly resolving the real client IP behind a CDN or load balancer.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Advanced
NGINX Zero-Downtime Reload & Binary Upgrade Prompt
Apply NGINX config and binary changes with zero dropped connections — safe reload workflow, graceful worker draining, on-the-fly binary upgrades with USR2/QUIT, and a rollback plan when a reload goes wrong.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Advanced
NGINX JWT / OAuth2 Token Validation Prompt
Validate JWT / OAuth2 access tokens at the NGINX edge before requests reach your backend — signature, expiry, issuer, audience, and scope checks — using auth_jwt (Plus) or an auth_request bridge to an introspection service on open-source NGINX.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Advanced
NGINX Security Response Headers & CSP Prompt
Add a correct, non-breaking security header baseline in NGINX — Content-Security-Policy, HSTS, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, frame controls — applied so headers survive error responses and don't get silently dropped by add_header inheritance rules.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Advanced
NGINX Slowloris & Timeout Hardening Prompt
Harden NGINX against slow-client and connection-exhaustion attacks — client/header/body timeouts, connection and request-rate limits, and buffer caps — tuned so real slow mobile clients aren't collateral damage.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Advanced
NGINX Stream (TCP/UDP) Load Balancing Prompt
Load-balance non-HTTP traffic through NGINX's stream module — TCP services like databases and message brokers, or UDP like DNS and syslog — with health checks, PROXY protocol, timeouts, and TLS passthrough or termination.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Advanced
NGINX auth_request Subrequest SSO Prompt
Design a correct `auth_request` gateway that offloads authentication to an external SSO/auth service — forwarding the right headers, handling 401/403 vs 5xx distinctly, and passing identity back to your app — instead of a fragile snippet that leaks unauthenticated traffic on the auth service's bad day.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Advanced
NGINX HTTP/3 (QUIC) Reverse-Proxy Setup Prompt
Generate a correct, production-ready HTTP/3 + QUIC server block for an existing NGINX reverse proxy — UDP 443 listeners, Alt-Svc advertisement, congestion/retry settings, and TLS 1.3 — without breaking your working HTTP/2 fallback.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Intermediate
NGINX Static-Asset Cache-Control & Immutable Versioning Prompt
Generate a correct static-asset caching policy for NGINX — long-lived immutable caching for fingerprinted bundles, short/revalidated caching for HTML, and no accidental caching of authenticated responses — so browsers and CDNs stop re-downloading unchanged files without ever serving stale HTML.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Advanced
NGINX Dynamic Upstream DNS Resolution Prompt
Make NGINX re-resolve backend DNS at runtime instead of caching it forever at startup — configure the resolver directive with variables in proxy_pass (or upstream re-resolution) — so proxying to cloud services, Kubernetes, or autoscaled targets stops sending traffic to dead IPs.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Advanced
NGINX FastCGI & PHP-FPM Tuning and Caching Prompt
Design a correct, fast NGINX-to-PHP-FPM FastCGI setup — sane socket vs TCP, right buffers and timeouts, and a safe fastcgi_cache layer — so PHP apps stop returning 502s under load and stop re-executing pages that could be served from cache.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Advanced
NGINX Real Client IP Behind a Load Balancer Prompt
Recover the true client IP when NGINX sits behind an L7 load balancer or CDN — configure real_ip / X-Forwarded-For or PROXY protocol with trusted-proxy scoping — so rate limits, geo rules, and access logs stop keying on the load balancer's address.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Advanced
Configure NGINX TLS, HSTS & OCSP Stapling Prompt
Build a modern, A-grade NGINX TLS configuration with correct protocol/cipher selection, OCSP stapling, session settings, and a safe HSTS rollout, then verify it against a real handshake.
- Claude
- ChatGPT
Open prompt - NGINX Intermediate
Debug NGINX 502/504 Upstream Errors Prompt
Diagnose why NGINX returns 502 Bad Gateway or 504 Gateway Timeout from an upstream by correlating the error log, the proxy block, and upstream health into a ranked root-cause list with fixes.
- Claude
- ChatGPT
Open prompt - NGINX Advanced
Design NGINX Rate Limiting with limit_req & limit_conn Prompt
Design layered NGINX rate limiting using limit_req (request rate + burst) and limit_conn (concurrency) to absorb abuse and bursts without throttling legitimate users, with the right key and shared-memory sizing.
- Claude
- ChatGPT
Open prompt - NGINX Intermediate
Fix NGINX Location Block Precedence Prompt
Untangle why the wrong NGINX location block is matching a request by tracing prefix vs regex vs exact-match precedence, then reorder/rewrite the blocks so each URL hits the intended handler.
- Claude
- ChatGPT
Open prompt - NGINX Advanced
Performance-Tune NGINX Workers, Keepalive & gzip Prompt
Tune NGINX for throughput and latency by setting worker/connection limits, keepalive (client and upstream), buffering, sendfile, and compression correctly for the hardware and workload, with measured before/after.
- Claude
- ChatGPT
Open prompt - NGINX Intermediate
Secure NGINX Reverse-Proxy Vhost Prompt
Write a hardened NGINX reverse-proxy server block that forwards correct headers, hides upstream details, sets sane security headers, and avoids common proxy footguns like open host headers and missing real-IP handling.
- Claude
- ChatGPT
Open prompt - NGINX Beginner
Troubleshoot NGINX Config That Fails nginx -t Prompt
Diagnose and fix an NGINX configuration that fails `nginx -t` by reading the exact error/line, explaining the underlying cause, and returning a corrected, test-passing config with the change isolated.
- Claude
- ChatGPT
Open prompt - NGINX Advanced
Tune NGINX proxy_cache for Hit Ratio Prompt
Design and tune NGINX proxy_cache to raise hit ratio and offload an upstream while respecting cache-control correctness, with the right cache key, zones, stale-serving, and purge strategy.
- Claude
- ChatGPT
Open prompt - NGINX Intermediate
Write Safe NGINX Redirect & Rewrite Rules Prompt
Author correct, loop-free NGINX redirects and rewrites that preserve query strings, use the right status code, avoid open redirects, and prefer return over rewrite where possible, with test cases.
- Claude
- ChatGPT
Open prompt - NGINX Advanced
NGINX gRPC & HTTP/2 Proxying Prompt
Generate a correct grpc_pass server block that terminates TLS, speaks HTTP/2 to your gRPC backend, and handles trailers and timeouts — instead of a plain proxy_pass that silently mangles streaming RPCs.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Beginner
NGINX gzip & Brotli Compression Prompt
Configure response compression correctly — the right MIME types, a sane compression level, no double-compressing already-compressed assets, and the Vary header — so you cut bandwidth without burning CPU or corrupting binary downloads.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Intermediate
NGINX Large Uploads & Request Buffering Prompt
Fix '413 Request Entity Too Large' and slow/timing-out uploads by tuning client_max_body_size, buffer sizes, and request buffering — so big file uploads stream to your backend instead of dying or eating disk.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Intermediate
NGINX Log Format Design & Analysis Prompt
Design a structured (JSON or key-value) access log format that captures upstream timing, request IDs, and cache status — then get a set of awk/jq one-liners to actually answer questions from it during an incident.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Intermediate
NGINX map & geo Conditional Routing Prompt
Replace a brittle pile of nested if blocks with clean map and geo directives — for feature flags, country routing, or per-host variables — so your config is fast, readable, and free of the 'if is evil' traps.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Advanced
NGINX mTLS Client Certificate Auth Prompt
Configure mutual TLS so NGINX requires and verifies client certificates — for service-to-service or partner APIs — with correct CA trust, verification depth, and the right variables passed to your backend.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Advanced
NGINX njs Scripting Prompt
Write a small, reviewable njs (NGINX JavaScript) module for request/response manipulation — header rewriting, JWT inspection, custom routing — instead of contorting the config language or reaching for Lua you don't need.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Advanced
NGINX Upstream Health Checks & Load Balancing Prompt
Design an upstream block with the right load-balancing algorithm, passive health checks, and failover tuning — so a single sick backend stops poisoning your error rate instead of getting quietly removed from rotation.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Intermediate
NGINX WebSocket Upgrade Proxying Prompt
Generate a WebSocket-safe proxy block — correct Upgrade/Connection map, long read timeouts, and disabled proxy buffering — so real-time connections stop dropping at 60 seconds or downgrading to plain HTTP.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Intermediate
NGINX 502/504 Bad Gateway Triage Prompt
Turn a wall of error.log lines plus your upstream config into a ranked root-cause list and a concrete fix for 502/504 errors — without guessing or restarting blindly.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Intermediate
Apache .htaccess to NGINX Translation Prompt
Translate an Apache vhost or .htaccess (RewriteRules, auth, headers, directory rules) into a correct NGINX server block — preserving behavior and flagging the rules that have no clean NGINX equivalent.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Advanced
NGINX Config Security Audit Prompt
Audit an NGINX config for the classic misconfigurations — version leakage, missing security headers, open proxy, path traversal, exposed dotfiles — and get a prioritized fix list with exact directives, not a generic checklist.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Advanced
NGINX location & Regex Precedence Prompt
Figure out exactly which location block NGINX picks for a given request and fix the ordering bug that's routing your URL to the wrong handler — with the matching rules made explicit, not folklore.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Advanced
NGINX Performance Tuning Prompt
Tune worker_processes, keepalive, buffers, sendfile, and connection limits to your actual hardware and traffic — producing a justified config diff, not cargo-culted values copied from a blog.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Advanced
NGINX Proxy Cache & Microcaching Prompt
Stand up proxy_cache (or 1-second microcaching) in front of a dynamic backend to absorb traffic spikes — with a correct cache key, bypass rules, and stale-while-revalidate — without serving stale or per-user content to the wrong people.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Advanced
NGINX Rate & Connection Limiting Prompt
Design limit_req and limit_conn zones that throttle abusive traffic and protect your backend — with burst, nodelay, and per-route tuning — without rate-limiting your own legitimate users into 503s.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Intermediate
NGINX Reverse-Proxy vhost Design Prompt
Generate a clean, production-ready reverse-proxy server block for your backend app — correct headers, timeouts, keepalive, and WebSocket support — instead of copy-pasting a Stack Overflow snippet that leaks the client IP.
- Claude
- ChatGPT
- Cursor
Open prompt - NGINX Advanced
NGINX TLS/SSL Hardening Prompt
Harden your NGINX TLS config to a modern, A-grade baseline — protocols, cipher suites, HSTS, OCSP stapling, session settings — without breaking older clients you actually need to support.
- Claude
- ChatGPT
- Cursor
Open prompt
About these NGINX AI prompts
This is a free, curated collection of NGINX AI prompts for DevOps and platform engineers — prompt templates that turn Claude, ChatGPT, or Cursor into a focused NGINX assistant. Instead of re-explaining your setup every time, each prompt has fill-in placeholders, a realistic worked example, and explicit safety and back-out notes, so it's safe to use against production NGINX.
Browse all 42 above, or explore the wider NGINX prompts and troubleshooting guides, the full DevOps AI prompt library, and run or compare any prompt live in the Prompt Workspace. Hit a production issue instead? Try the free Incident Assistant.