feat(nginx): 新增请求速率限制

这个提交包含在:
2024-10-30 19:01:57 +08:00 未验证
父节点 12fbd55e29
当前提交 4cfeba80ca
修改 2 个文件,包含 25 行新增14 行删除
+7 -2
查看文件
@@ -34,15 +34,20 @@ spec:
ssl-redirect: "true"
# 自定义错误页面
custom-http-errors: "403,404,502,503"
# 缓存配置
http-snippet: |
# 缓存配置
proxy_cache_path /tmp/nginx-cache levels=1:2 keys_zone=cache:2m max_size=100m inactive=7d use_temp_path=off;
proxy_cache_key $uri$is_args$args;
proxy_cache_lock on;
proxy_cache_use_stale updating;
# dns配置
# 限速配置
limit_req_zone $binary_remote_addr zone=global_limit:10m rate=10r/s;
server-snippet : |
# dns配置
resolver 169.254.20.10 10.43.0.10 ipv6=off;
location-snippet: |
# 限速配置
limit_req zone=global_limit burst=30 nodelay;
# 启用geoip2模块
use-geoip: "false"
use-geoip2: "true"