Loading...
Loading...
Guide for configuring Nginx web server with custom request logging, rate limiting, and error pages. This skill should be used when tasks involve Nginx installation, configuration, custom log formats, rate limiting setup, or custom error page creation.
npx skill4agent add letta-ai/skills nginx-request-logging/etc/nginx/nginx.confincludewhich nginxnginx -vpgrep nginxps aux | grep nginxss -tlnp | grep <port>netstat -tlnp | grep <port>cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak/etc/nginx/nginx.conf/etc/nginx/conf.d//etc/nginx/sites-available//etc/nginx/sites-enabled/| Setting Type | Location | Reason |
|---|---|---|
| Log format definitions | | Must be defined before use in server blocks |
| Rate limiting zones | | Zones are shared across server blocks |
| Server blocks | | Modular, easy to manage |
| Custom error pages | Server block or location block | Context-specific |
limit_req_zone $binary_remote_addr zone=zonename:10m rate=10r/s;limit_req zone=zonename burst=5 nodelay;log_format custom_format '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';access_log /var/log/nginx/custom_access.log custom_format;| Environment | Start Command | Reload Command | Stop Command |
|---|---|---|---|
| systemd | | | |
| Direct | | | |
| Docker/Container | | | |
nginx -tcurl -s http://localhost:<port>/
curl -s -o /dev/null -w "%{http_code}" http://localhost:<port>/nonexistentseq 20 | xargs -P 20 -I {} curl -s -o /dev/null -w "%{http_code}\n" http://localhost:<port>/for i in {1..20}; do curl -s http://localhost:<port>/; done # Too slow, sequentialtail -f /var/log/nginx/access.log
tail -f /var/log/nginx/error.logxargs -Pnginx -tss -tlnpnginxrm -f /etc/nginx/sites-enabled/defaultls -la /etc/nginx/conf.d/mkdir -prm -fnginx -t