initial release

This commit is contained in:
root
2026-06-03 09:23:53 +08:00
commit cbfaacb466
26 changed files with 3962 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
# Rate limiting: 10 requests per second per IP (burst 20)
limit_req_zone $binary_remote_addr zone=web:10m rate=10r/s;
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Apply rate limiting to all requests
limit_req zone=web burst=20 nodelay;
limit_req_status 429;
# Gzip
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript image/svg+xml;
gzip_min_length 256;
location / {
try_files $uri $uri/ /index.html;
}
# Cache static assets
location /assets/ {
expires 1y;
add_header Cache-Control "public, immutable";
}
error_page 429 /429.html;
location = /429.html {
internal;
default_type text/html;
return 429 '<!DOCTYPE html><html lang="zh-CN"><head><meta charset="UTF-8"><title>429 Too Many Requests</title><style>body{font-family:sans-serif;display:flex;justify-content:center;align-items:center;height:100vh;margin:0;background:#0f172a;color:#e2e8f0}div{text-align:center}h1{font-size:3rem;margin:0;color:#ef4444}p{color:#94a3b8}</style></head><body><div><h1>429</h1><p>请求过于频繁,请稍后再试</p><p style="font-size:12px;color:#64748b">Rate limit: 10 requests/second per IP</p></div></body></html>';
}
}