fix: limit Jeannie API edge traffic
This commit is contained in:
parent
b7424c3942
commit
df6ae89e7d
|
|
@ -12,7 +12,7 @@ access_log /var/log/nginx/crowdsec-access.log;
|
|||
error_log /var/log/nginx/crowdsec-error.log warn;
|
||||
|
||||
limit_req_zone $binary_remote_addr zone=one:10m rate=10r/s;
|
||||
limit_req_zone $binary_remote_addr zone=jeannie_api:10m rate=10r/s;
|
||||
limit_req_zone $binary_remote_addr zone=jeannie_api:10m rate=2r/s;
|
||||
|
||||
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=static_assets:10m max_size=100m inactive=24h;
|
||||
proxy_cache_path /var/cache/nginx_dynamic levels=1:2 keys_zone=dynamic_content:5m max_size=50m inactive=1h;
|
||||
|
|
@ -126,7 +126,7 @@ server {
|
|||
}
|
||||
|
||||
location / {
|
||||
limit_req zone=jeannie_api burst=20 nodelay;
|
||||
limit_req zone=jeannie_api;
|
||||
client_max_body_size 64k;
|
||||
|
||||
proxy_pass http://jeannie_api_backend;
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ edge proxy at `api.lab2025.duckdns.org`. The backend remains the Debian host
|
|||
at `192.168.100.73:8787`; Kubernetes does not run a second Jeannie server and
|
||||
is not required for API availability.
|
||||
|
||||
The edge gateway applies a per-client rate limit of 10 requests per second
|
||||
with a burst of 20, forwards the bearer token to Debian, and uses 35-second
|
||||
The edge gateway applies a per-client rate limit of 2 requests per second with
|
||||
no burst, forwards the bearer token to Debian, and uses 35-second
|
||||
proxy read/write timeouts. The Jeannie API remains responsible for bearer
|
||||
authentication and command allowlisting. Read-only retries are not enabled at
|
||||
the edge; `POST /v1/execute` is never retried so a command cannot be submitted
|
||||
|
|
|
|||
Loading…
Reference in New Issue