Skip to content

Commit

Permalink
Allow the rate limit log levels to be configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
GUI committed Oct 23, 2017
1 parent 39200bd commit a804e0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ router:
ip_rate:
ip_burst:
ip_rate_size: 8m
ip_rate_log_level: error
ip_connections:
ip_connections_size: 5m
ip_connections_log_level: error
web_app_host: "*"
web_app_backend_regex: "^/(admin|admins|web-assets)(/|$)"
web_app_backend_required_https_regex: "^/(admin|admins)(/|$)"
Expand Down
2 changes: 2 additions & 0 deletions templates/etc/nginx/router.conf.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ http {
# Limit the number of simultaneous connections per IP address.
limit_conn_zone $binary_remote_addr zone=api_umbrella_conn_addr_zone:{{router.global_rate_limits.ip_connections_size}};
limit_conn_status {{apiSettings.error_data.over_rate_limit.status_code}};
limit_conn_log_level {{router.global_rate_limits.ip_connections_log_level}};
{{/router.global_rate_limits.ip_connections}}

{{#router.global_rate_limits.ip_rate}}
Expand All @@ -159,6 +160,7 @@ http {
# against misbehaving clients from overloading the Gatekeeper.
limit_req_zone $binary_remote_addr zone=api_umbrella_req_addr_zone:{{router.global_rate_limits.ip_rate_size}} rate={{router.global_rate_limits.ip_rate}};
limit_req_status {{apiSettings.error_data.over_rate_limit.status_code}};
limit_req_log_level {{router.global_rate_limits.ip_rate_log_level}};
{{/router.global_rate_limits.ip_rate}}

# Allow any sized uploads to backends.
Expand Down

0 comments on commit a804e0c

Please sign in to comment.