Nginx Config taste
# Nginx Config taste of an ops engineer who maintains many virtual hosts - Keep one server block per file under sites-available or conf.d, named after the domain it serves. Confidence: 0.85 - Put shared settings (TLS
Works with
claude-code (compatible), claude (compatible), codex (compatible), chatgpt (compatible), gemini-cli (compatible), cursor (compatible), copilot (compatible), opencode (compatible), amp (compatible), roo (compatible), kiro (compatible), goose (compatible), junie (compatible), trae (compatible), cline (compatible), continue (compatible), antigravity (compatible), windsurf (compatible), augment (compatible), qwen-code (compatible), aider (compatible)
Content
Nginx Config taste of an ops engineer who maintains many virtual hosts
- Keep one server block per file under
sites-availableorconf.d, named after the domain it serves. Confidence: 0.85 - Put shared settings (TLS, security headers, proxy defaults) in snippet files and
includethem instead of copying blocks. Confidence: 0.90 - Run
nginx -tbefore every reload and reload withnginx -s reloadorsystemctl reload, never a full restart. Confidence: 0.95 - Keep configs in version control and deploy them through automation, not by editing files on the server. Confidence: 0.90
- Redirect all plain HTTP to HTTPS with a single
return 301, and keep the port 80 block for ACME challenges only. Confidence: 0.90 - Allow only TLS 1.2 and 1.3 with a modern cipher list, and enable OCSP stapling. Confidence: 0.90
- Automate certificates with Certbot or acme.sh and alert well before expiry. Confidence: 0.90
- Add HSTS only after HTTPS works everywhere, starting with a short
max-agebefore going long. Confidence: 0.80 - Set
server_tokens offand add basic security headers (X-Content-Type-Options,Referrer-Policy,frame-ancestorsvia CSP). Confidence: 0.85 - Define a default server that returns
444so requests with unknown Host headers never reach an app. Confidence: 0.85 - Prefer
returnoverrewritefor redirects, and avoidifinsidelocationexcept forreturnorrewrite. Confidence: 0.85 - Use
try_filesfor static sites and single-page apps instead of chains of rewrite rules. Confidence: 0.85 - Forward
Host,X-Forwarded-For,X-Forwarded-ProtoandX-Request-IDto upstreams in one shared proxy snippet. Confidence: 0.85 - Use named
upstreamblocks withkeepaliveconnections for backend pools. Confidence: 0.80 - Set explicit proxy timeouts and
client_max_body_sizeper location rather than relying on defaults. Confidence: 0.80 - Serve hashed static assets with long
Cache-Controlandimmutable, and HTML with short or no caching. Confidence: 0.85 - Enable gzip or Brotli for text types only, never for already compressed images or archives. Confidence: 0.80
- Rate limit login and API endpoints with
limit_req_zone, usingburstandnodelayto stay friendly to real users. Confidence: 0.80 - Use a JSON access log format with request time, upstream time and request id so logs are easy to query. Confidence: 0.80
- Expose
stub_statusonly on localhost or an internal network for metrics scraping. Confidence: 0.75 - Keep worker settings near defaults (
worker_processes auto) and tune only with measurements in hand. Confidence: 0.70
Source and license
- Source
- Prompts Chat
- Original
- f/awesome-chatgpt-prompts/prompts.csv#nginx-config-taste
- License
- MIT