19 lines
569 B
Plaintext
19 lines
569 B
Plaintext
# Paste into NPM Custom Location advanced config for write-heavy API paths,
|
|
# for example:
|
|
# - /api/entries
|
|
# - /api/buckets
|
|
# - /api/groups
|
|
# - /api/tags
|
|
# - /api/recurring-entries
|
|
#
|
|
# Requires `limit_req_zone fiddy_write` in http context.
|
|
|
|
# Keep request-id forwarding/header here too because this location is
|
|
# more specific than `/` and can bypass root location directives.
|
|
add_header X-Request-Id $request_id always;
|
|
proxy_set_header X-Request-Id $request_id;
|
|
|
|
if ($request_method ~* "(POST|PATCH|PUT|DELETE)") {
|
|
limit_req zone=fiddy_write burst=40 nodelay;
|
|
}
|