Nginx Configuration

Nginx Configuration

Guides a coding agent to configure Nginx for production: reverse proxying, load balancing, SSL/TLS, caching, rate limiting and API gateway setups.

Skill files7 files

references/

scripts/

templates/

SKILL.md101 lines
1
---
2
name: nginx-configuration
3
description: >
4
Configure Nginx web server for high-performance reverse proxy, load balancing,
5
SSL/TLS, caching, and API gateway functionality.
6
---
7
8
# Nginx Configuration
9
10
## Table of Contents
11
12
- [Overview](#overview)
13
- [When to Use](#when-to-use)
14
- [Quick Start](#quick-start)
15
- [Reference Guides](#reference-guides)
16
- [Best Practices](#best-practices)
17
18
## Overview
19
20
Master Nginx configuration for production-grade web servers, reverse proxies, load balancing, SSL termination, caching, and API gateway patterns with advanced performance tuning.
21
22
## When to Use
23
24
- Reverse proxy setup
25
- Load balancing between backend services
26
- SSL/TLS termination
27
- HTTP/2 and gRPC support
28
- Caching and compression
29
- Rate limiting and DDoS protection
30
- URL rewriting and routing
31
- API gateway functionality
32
33
## Quick Start
34
35
Minimal working example:
36
37
```nginx
38
# /etc/nginx/nginx.conf
39
user nginx;
40
worker_processes auto;
41
worker_rlimit_nofile 65535;
42
error_log /var/log/nginx/error.log warn;
43
pid /var/run/nginx.pid;
44
45
events {
46
worker_connections 4096;
47
use epoll;
48
multi_accept on;
49
}
50
51
http {
52
include /etc/nginx/mime.types;
53
default_type application/octet-stream;
54
55
# Logging
56
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
57
'$status $body_bytes_sent "$http_referer" '
58
'"$http_user_agent" "$http_x_forwarded_for"';
59
60
log_format upstream_time '$remote_addr - $remote_user [$time_local] '
61
'"$request" $status $body_bytes_sent '
62
'"$http_referer" "$http_user_agent" '
63
// ... (see reference guides for full implementation)
64
```
65
66
## Reference Guides
67
68
Detailed implementations in the `references/` directory:
69
70
| Guide | Contents |
71
|---|---|
72
| [Production Nginx Configuration](references/production-nginx-configuration.md) | Production Nginx Configuration |
73
| [HTTPS Server with Load Balancing](references/https-server-with-load-balancing.md) | HTTPS Server with Load Balancing |
74
| [Nginx Configuration Script](references/nginx-configuration-script.md) | Nginx Configuration Script |
75
| [Nginx Monitoring Configuration](references/nginx-monitoring-configuration.md) | Nginx Monitoring Configuration |
76
77
## Best Practices
78
79
### ✅ DO
80
81
- Use HTTP/2 for performance
82
- Enable SSL/TLS with strong ciphers
83
- Implement proper caching strategies
84
- Use upstream connection pooling
85
- Monitor with stub_status or prometheus
86
- Rate limit to prevent abuse
87
- Add security headers
88
- Use least_conn load balancing
89
- Keep error logs separate from access logs
90
91
### ❌ DON'T
92
93
- Disable gzip compression
94
- Use weak SSL ciphers
95
- Cache authenticated responses
96
- Allow direct access to backends
97
- Ignore upstream health checks
98
- Mix HTTP and HTTPS without redirect
99
- Use default error pages in production
100
- Cache sensitive user data
101

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…