nginx-configuration

Configure Nginx logging, rate limiting, and custom error pages.

134|21|Updated Nov 12, 2025
One-click install
npx skills add https://github.com/letta-ai/skills --skill nginx-configuration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nginx-configuration
Source: https://github.com/letta-ai/skills/tree/main/ai/benchmarks/letta/terminal-bench-2/trajectory-only/nginx-request-logging/references/nginx_configuration.md
Command: npx skills add https://github.com/letta-ai/skills --skill nginx-configuration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This reference explains nginx log formats, rate limiting Directives, and server block configuration for reliable, secure deployments.

Core Features & Use Cases

  • Log_format and access_log configuration
  • limit_req_zone and limit_req directives
  • Server-level and location-level configuration patterns

Quick Start

Apply a sample configuration that adds custom logging and rate limiting, then validate with nginx -t.

Frequently Asked Questions about nginx-configuration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up custom logging formats in nginx?

Custom logging formats in nginx are defined using the log_format directive, which lets you specify which request and response data to capture. You define a named format with variables like $remote_addr, $request_uri, and $status, then apply it to access_log statements in server or location blocks to write structured logs.

How can I implement rate limiting in nginx?

Rate limiting in nginx uses the limit_req_zone directive to define a zone that tracks requests, and limit_req to enforce the limit. You specify a key (like $binary_remote_addr for IP-based limiting), a rate (requests per second), and a burst size, then apply it to server or location blocks to reject excess traffic.

What's the best way to organize multiple server blocks in nginx?

Server blocks are organized by listening port and server_name directive, with each block handling specific domain or subdomain routing. Group related blocks logically, validate syntax with nginx -t, and reload the service to apply changes without downtime across systemd, container, or direct deployment environments.

Can I use custom error pages with nginx rate limiting?

Yes, custom error pages are configured using the error_page directive to map HTTP status codes to custom responses. You can combine this with rate limiting by specifying error_page 429 to show a custom page when limit_req rejects requests, improving user experience during traffic spikes.

How do I validate nginx configuration before restarting the service?

Use the nginx -t command to test your configuration syntax and file permissions without restarting the service. This catches errors in log_format, limit_req directives, server blocks, and error_page settings before they cause downtime, making it essential before applying any configuration changes.

Does nginx support rate limiting on non-standard ports?

Yes, rate limiting applies to any port configured in the listen directive, including non-standard ports. Define your server block with the desired port, add limit_req_zone and limit_req directives, then validate and reload to enforce rate limits on that port.