openvibers/openvibe.work Commits

Work's vhost: saved-search writes get their own method-keyed zone (nginx refuses limit_req inside limit_except)

OP OpenVibers committed 8 Oct 2026 · 535db4edbc · 1 file, +10 −4


Changes

ddiff --git a/deploy/nginx/openvibe.work.conf b/deploy/nginx/openvibe.work.conf
iindex aad0cdf..8948167 100644
---- a/deploy/nginx/openvibe.work.conf
++++ b/deploy/nginx/openvibe.work.conf
@@@ -12,6 +12,14 @@
limit_req_zone $binary_remote_addr zone=work_auth:10m rate=10r/m;
limit_req_zone $binary_remote_addr zone=work_api:10m rate=5r/s;
limit_req_zone $binary_remote_addr zone=work_forms:10m rate=1r/s;
++# Saved-search writes only: reads of /saved get an empty key, which nginx does not count (limit_req is not allowed
++# inside limit_except).
++map $request_method $work_saved_write_key {
++ GET "";
++ HEAD "";
++ default $binary_remote_addr;
++}
++limit_req_zone $work_saved_write_key zone=work_saved_writes:10m rate=1r/s;
server {
listen 80;
@@@ -99,10 +107,8 @@ server {
# Saving or forgetting a saved search is a write made with a session cookie: the strict form zone, but reading
# /saved is an ordinary page and keeps the page budget (the browser reloads it freely).
location ~ ^/saved(/[A-Za-z0-9_-]+/delete)?$ {
-- limit_except GET HEAD {
-- limit_req zone=work_forms burst=10 nodelay;
-- limit_req_status 429;
-- }
++ limit_req zone=work_saved_writes burst=10 nodelay;
++ limit_req_status 429;
proxy_pass http://127.0.0.1:4960;
}