Ask Claude to Write Nginx or Caddy Server Configs
Web server config is fiddly and full of footguns. Describe your deployment requirements and let Claude write a config that actually handles the edge cases correctly.
"Write an Nginx server block for a Laravel app:
- Domain: app.example.com with automatic www redirect
- PHP-FPM on socket /run/php/php8.3-fpm.sock
- Gzip compression for HTML, CSS, and JavaScript
- Cache-Control: immutable headers for hashed asset filenames
- Rate limit the /api/ prefix to 60 requests/minute per IP
- X-Forwarded-For handling for requests behind a load balancer"
The settings that are easy to forget — try_files order for SPAs, client_max_body_size for file uploads, real_ip_header behind proxies — Claude gets right the first time and explains each directive so you understand what you're deploying.
location ~* \.(js|css|png|jpg|woff2)$ {
expires max;
add_header Cache-Control "public, immutable";
access_log off;
}
For Caddy users, the same prompt style produces a Caddyfile instead. Caddy handles TLS automatically, so the config is shorter — but rate limiting, compression, and cache headers still need to be explicit.
Include your server's PHP version, whether you're behind Cloudflare, and any path-specific rules upfront. The more specific your prompt, the less back-and-forth.
Web server configs have a dozen easy-to-miss directives — get Claude to write one you'll actually want to put in version control.
Log in to leave a comment.
Set up Claude Code as an automated reviewer in your CI pipeline — on every pull request, it reads the diff, checks for bugs, security issues, missing tests, and convention violations, then posts its findings as a PR comment. Your human reviewers get a head start because the obvious issues are already flagged before they look.
Before deploying, tell Claude to read your project — migrations, environment variables, queue workers, scheduled tasks, caching, third-party integrations — and generate a deployment checklist that's specific to your app. Not a generic "did you run migrations?" list, but one that knows YOUR infrastructure and catches the things YOUR deploy can break.
Instead of writing a README from memory or copying a template, tell Claude to read your project and generate one that's actually accurate — real setup instructions from your config, real architecture from your directory structure, real API examples from your routes, and real prerequisites from your dependency files.