docs(config): 改进配置示例格式和注释
- 改进一致性哈希配置注释说明 - 改进滑动窗口限流配置注释说明 - 更新 gzip_static 配置示例 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
ec916d882d
commit
2c54e512d8
@ -25,9 +25,9 @@ server:
|
||||
# weight: 3 # 权重(加权轮询时有效)
|
||||
# - url: http://backend2:8080
|
||||
# weight: 1
|
||||
# load_balance: round_robin # 负载均衡算法: round_robin, weighted_round_robin, least_conn, ip_hash, consistent_hash
|
||||
# hash_key: "ip" # 一致性哈希键(有效值: ip, uri, header:X-Name)
|
||||
# virtual_nodes: 150 # 一致性哈希虚拟节点数
|
||||
# load_balance: round_robin # 负载均衡算法(有效值: round_robin, weighted_round_robin, least_conn, ip_hash, consistent_hash)
|
||||
# hash_key: ip # 一致性哈希键(仅 load_balance=consistent_hash 时有效,有效值: ip, uri, header:X-Name)
|
||||
# virtual_nodes: 150 # 一致性哈希虚拟节点数(仅 load_balance=consistent_hash 时有效)
|
||||
# health_check: # 健康检查
|
||||
# interval: 10s
|
||||
# path: /health
|
||||
@ -75,9 +75,9 @@ server:
|
||||
burst: 0 # 突发上限
|
||||
conn_limit: 0 # 连接数限制
|
||||
key: "ip" # 限流 key 来源(有效值: ip, header)
|
||||
algorithm: "token_bucket" # 限流算法(有效值: token_bucket, sliding_window)
|
||||
sliding_window_mode: "approximate" # 滑动窗口模式(有效值: approximate, precise)
|
||||
sliding_window: 60 # 滑动窗口大小(秒)
|
||||
algorithm: "token_bucket" # 限流算法(有效值: token_bucket, sliding_window)
|
||||
sliding_window_mode: "approximate" # 滑动窗口模式(有效值: approximate, precise,仅 algorithm=sliding_window 时有效)
|
||||
sliding_window: 60 # 滑动窗口大小(秒,仅 algorithm=sliding_window 时有效)
|
||||
|
||||
# 认证配置(type 为空时禁用)
|
||||
auth:
|
||||
@ -107,20 +107,16 @@ server:
|
||||
type: "gzip" # 压缩类型(有效值: gzip, brotli, both,空表示禁用)
|
||||
level: 6 # 压缩级别(范围 1-9,值越大压缩率越高但速度越慢)
|
||||
min_size: 1024 # 最小压缩大小(字节,小于此值不压缩)
|
||||
gzip_static: false # 启用预压缩文件支持(自动查找 .gz/.br 文件)
|
||||
gzip_static_extensions: # 预压缩文件扩展名
|
||||
- ".gz"
|
||||
- ".br"
|
||||
types: # 可压缩的 MIME 类型
|
||||
- "text/html"
|
||||
- "text/css"
|
||||
- "text/javascript"
|
||||
- "application/json"
|
||||
- "application/javascript"
|
||||
gzip_static: true # 启用预压缩文件支持(检测 .gz 文件)
|
||||
gzip_static_extensions: # 预压缩文件扩展名
|
||||
- ".html"
|
||||
- ".css"
|
||||
- ".js"
|
||||
- ".json"
|
||||
- ".xml"
|
||||
- ".svg"
|
||||
|
||||
# 多虚拟主机模式(可选,每个虚拟主机支持完整的 server 配置)
|
||||
# servers:
|
||||
@ -171,14 +167,6 @@ server:
|
||||
# 默认 TLS 协议: TLSv1.2, TLSv1.3(不支持 TLSv1.0/1.1)
|
||||
# 默认 HSTS 配置: max_age=31536000(1年), include_sub_domains=true
|
||||
|
||||
# HTTP/3 (QUIC) 配置(可选)
|
||||
# http3:
|
||||
# enabled: false # 是否启用 HTTP/3
|
||||
# listen: ":443" # UDP 监听地址
|
||||
# max_streams: 100 # 最大并发流数
|
||||
# idle_timeout: 30s # 空闲超时
|
||||
# enable_0rtt: false # 启用 0-RTT 快速连接
|
||||
|
||||
# TCP/UDP Stream 代理配置(可选)
|
||||
# stream:
|
||||
# - listen: "3306" # 监听地址
|
||||
@ -221,6 +209,14 @@ performance:
|
||||
idle_conn_timeout: 90s # 空闲超时
|
||||
max_conns_per_host: 0 # 每主机最大连接(0 表示不限制)
|
||||
|
||||
# HTTP/3 (QUIC) 配置(需要 SSL 证书)
|
||||
http3:
|
||||
enabled: false # 是否启用 HTTP/3
|
||||
listen: ":443" # UDP 监听地址
|
||||
max_streams: 100 # 最大并发流
|
||||
idle_timeout: 60s # 空闲超时
|
||||
enable_0rtt: false # 启用 0-RTT(早期数据,可能存在安全风险)
|
||||
|
||||
# 监控配置
|
||||
monitoring:
|
||||
status:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user