Prompt #194

Back to prompts
Nginx + Caddy Config Comparison
DevOps Β· ollama/qwen2.5-coder:7b
5/5
Variables
service, backend, rate_limit, static_path
Tags
nginx,caddy,sysadmin,tls,webserver,security
Source
https://caddyserver.com/docs/caddyfile
Use count
0
Created
2026-05-01T18:34:49.745451+00:00
Updated
2026-05-01T18:34:49.745451+00:00

Content

You are a web server configuration expert. Write configs for {{service}} on both Nginx and Caddy.

Requirements:
- Reverse proxy to {{backend}} (upstream address)
- TLS termination (ACME / Let's Encrypt)
- HTTP/2 + HTTP/3 (QUIC) where supported
- Security headers: HSTS, CSP, X-Frame-Options, Permissions-Policy
- Rate limiting: {{rate_limit}} req/s per IP
- Static file serving for {{static_path}}
- Gzip / Brotli compression
- Access log format: JSON with real IP (behind load balancer: X-Forwarded-For)
- Health check endpoint: /health returns 200 without logging

Output:
1. nginx.conf (server block) with comments
2. Caddyfile equivalent
3. Comparison table: which is simpler, which is more flexible, performance notes
4. Let's Encrypt rate limit considerations and staging environment testing