new
This commit is contained in:
@@ -118,3 +118,42 @@ wallet:
|
||||
- recharge_amount: 10000.00 # 充值10000元
|
||||
bonus_amount: 800.00 # 赠送800元
|
||||
|
||||
# ===========================================
|
||||
# 🚦 频率限制配置 - 生产环境
|
||||
# ===========================================
|
||||
daily_ratelimit:
|
||||
max_requests_per_day: 50000 # 生产环境每日最大请求次数
|
||||
max_requests_per_ip: 5000 # 生产环境每个IP每日最大请求次数
|
||||
max_concurrent: 200 # 生产环境最大并发请求数
|
||||
|
||||
# 排除频率限制的路径
|
||||
exclude_paths:
|
||||
- "/health" # 健康检查接口
|
||||
- "/metrics" # 监控指标接口
|
||||
|
||||
# 排除频率限制的域名
|
||||
exclude_domains:
|
||||
- "api.*" # API二级域名不受频率限制
|
||||
- "*.api.*" # 支持多级API域名
|
||||
|
||||
# 生产环境安全配置(严格限制)
|
||||
enable_ip_whitelist: false # 生产环境不启用IP白名单
|
||||
enable_ip_blacklist: true # 启用IP黑名单
|
||||
ip_blacklist: # 生产环境IP黑名单
|
||||
- "192.168.1.100" # 示例:被禁止的IP
|
||||
- "10.0.0.50" # 示例:被禁止的IP
|
||||
|
||||
enable_user_agent: true # 启用User-Agent检查
|
||||
blocked_user_agents: # 被阻止的User-Agent
|
||||
- "curl" # 阻止curl请求
|
||||
- "wget" # 阻止wget请求
|
||||
- "python-requests" # 阻止Python requests
|
||||
|
||||
enable_referer: true # 启用Referer检查
|
||||
allowed_referers: # 允许的Referer
|
||||
- "https://console.tianyuanapi.com"
|
||||
- "https://consoletest.tianyuanapi.com"
|
||||
|
||||
enable_geo_block: false # 生产环境暂时不启用地理位置阻止
|
||||
enable_proxy_check: true # 启用代理检查
|
||||
|
||||
|
||||
Reference in New Issue
Block a user