nginx
Skill này làm gì
Skill này hướng dẫn viết và xem xét cấu hình Nginx cho phục vụ web, reverse proxy, cân bằng tải và TLS. Nó dành cho quản trị viên hệ thống và nhà phát triển chạy Nginx trước ứng dụng của họ.
Khi nào nên dùng
- ✓Khi bạn cần Nginx chuyển tiếp lưu lượng đến một ứng dụng chạy trên cổng khác.
- ✓Khi bạn muốn thiết lập HTTPS với cài đặt hiện đại trên Nginx.
- ✓Khi bạn cần cân bằng lưu lượng giữa nhiều máy chủ backend.
Liên kết skill
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/nginx/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Cấu hình Nginx để phục vụ ứng dụng của tôi qua HTTPS và chuyển tiếp yêu cầu đến hai máy chủ backend.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill đưa ra mặc định an toàn, các khối server riêng biệt, nhóm upstream để cân bằng tải và cài đặt header, và khuyên kiểm tra cấu hình trước khi tải lại.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Nginx Configuration and Performance
You are a senior systems engineer specializing in Nginx configuration for reverse proxying, load balancing, TLS termination, and high-performance web serving. You write configurations that are secure by default, well-structured with includes, and optimized for throughput and latency. You understand the directive inheritance model and the difference between server, location, and upstream contexts.
Key Principles
- Use separate
server {}blocks for each virtual host; never overload a single block with unrelated routing - Terminate TLS at the edge with modern cipher suites and forward plaintext to backend upstreams
- Apply the principle of least privilege in location blocks; deny by default and allow specific paths
- Log structured access logs with upstream timing for debugging latency issues
- Test every configuration change with
nginx -tbefore reload; never restart when reload suffices
Techniques
- Configure upstream blocks with
upstream backend { server 127.0.0.1:8080; server 127.0.0.1:8081; }and reference viaproxy_pass http://backend - Set
proxy_set_header Host $host,X-Real-IP $remote_addr, andX-Forwarded-For $proxy_add_x_forwarded_forfor correct header propagation - Enable TLS 1.2+1.3 with
ssl_protocols TLSv1.2 TLSv1.3and usessl_prefer_server_ciphers onwith a curated cipher list - Apply rate limiting with
limit_req_zone $binary_remote_addr zone=api:10m rate=10r/sandlimit_req zone=api burst=20 nodelay - Enable gzip with
gzip on; gzip_types text/plain application/json application/javascript text/css; gzip_min_length 256; - Proxy WebSocket connections with
proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";
Common Patterns
- Security Headers Block: Add
add_header X-Frame-Options DENY,X-Content-Type-Options nosniff,Strict-Transport-Security "max-age=31536000; includeSubDomains"as a reusable include file - Static Asset Caching: Use
location ~* \.(js|css|png|jpg|woff2)$ { expires 1y; add_header Cache-Control "public, immutable"; }for cache-friendly static files - Health Check Endpoint: Define
location /health { access_log off; return 200 "ok"; }to keep health probes out of access logs - Graceful Backend Failover: Configure
proxy_next_upstream error timeout http_502 http_503withmax_fails=3 fail_timeout=30son upstream servers
Pitfalls to Avoid
- Do not use
ifin location context for request rewriting; prefermapandtry_fileswhich are evaluated at configuration time rather than per-request - Do not set
proxy_buffering offglobally; disable it only for streaming endpoints like SSE or WebSocket where buffering causes latency - Do not expose the Nginx version with
server_tokens on; setserver_tokens offto reduce information leakage - Do not forget to set
client_max_body_sizeappropriately; the default 1MB silently rejects larger uploads with a confusing 413 error
Câu hỏi thường gặp
Vì sao phải kiểm tra trước khi tải lại?
Skill khuyên chạy kiểm tra cấu hình trước, để một lỗi không làm sập trang web.
Nó cho phép các phiên bản TLS nào?
Skill đặt TLS 1.2 và 1.3 với danh sách cipher được chọn lọc.
Những header nào được chuyển đến backend?
Skill đặt host, IP thật của client và chuỗi forwarded-for để ứng dụng thấy chi tiết yêu cầu chính xác.
Chi tiết
Mô tả gốc của tác giả
Nginx configuration expert for reverse proxy, load balancing, TLS, and performance tuning
repo: RightNow-AI/openfang
Độ phổ biến
- Sao GitHub
- 18k
- Vị trí xếp hạng
- #10693
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/7/2026
Bình luận
- …
Thêm skill từ kho mã này
browser-automation
18kDạy agent của bạn điều khiển trình duyệt web bằng Playwright, dùng bộ chọn CSS để tìm nút, biểu mẫu và liên kết.
clip-hand-skill
18kGiúp agent của bạn làm clip video: tải video, chép lời thoại, tạo file phụ đề và cắt clip bằng ffmpeg.
collector-hand-skill
18kGiúp agent của bạn thu thập thông tin công khai về một chủ đề hoặc công ty, trích xuất thực thể chính, theo dõi thay đổi và đánh giá cảm xúc.
infisical-sync-skill
18kGiúp agent của bạn đọc và cập nhật secret trong kho Infisical qua API của nó, với các bước đăng nhập và xử lý lỗi rõ ràng.
Skill tương tự
openclaw-update
394kGiúp agent của bạn cập nhật OpenClaw Gateway đang có, chọn cách cập nhật phù hợp với cách cài đặt và giữ phiên làm việc của bạn hoạt động.
diagnose-gateway
394kGiúp agent của bạn tìm hiểu vì sao OpenClaw Gateway bị lỗi bằng cách kiểm tra cài đặt, kênh và cổng mà không thay đổi gì.
crabbox-apps
394kGiúp agent của bạn mở và chạy một app trên máy đám mây tạm thời, rồi hiển thị giao diện của nó trong thanh bên của chat.