Commit d94a533b by Qubad786

modify rate limiting

parent 5b1dbcac
......@@ -225,9 +225,9 @@ EDXAPP_CMS_NGINX_PORT: 18010
EDXAPP_CMS_SSL_NGINX_PORT: 48010
# NGINX Rate limiting related vars
EDXAPP_ENABLE_RATE_LIMITING: false
EDXAPP_ENABLE_RATE_LIMITING: true
EDXAPP_COURSE_REQUEST_RATE: '5r/s'
EDXAPP_COURSE_REQUEST_BURST_RATE: 10
EDXAPP_COURSE_REQUEST_BURST_RATE: 0
EDXAPP_LANG: 'en_US.UTF-8'
EDXAPP_LANGUAGE_CODE : 'en'
......
......@@ -13,7 +13,7 @@ upstream lms-backend {
{%- if EDXAPP_ENABLE_RATE_LIMITING -%}
# Make Zone
limit_req_zone $cookie_{{ EDXAPP_SESSION_COOKIE_NAME }} zone=cookies:10m rate={{ EDXAPP_COURSES_REQUEST_RATE }};
limit_req_zone $cookie_{{ EDXAPP_SESSION_COOKIE_NAME }} zone=cookies:10m rate=12r/m;
{%- endif %}
......@@ -198,7 +198,7 @@ error_page {{ k }} {{ v }};
location /courses {
{%- if EDXAPP_ENABLE_RATE_LIMITING -%}
# Set Limit
limit_req zone=cookies burst={{ EDXAPP_COURSE_REQUEST_BURST_RATE }};
limit_req zone=cookies;
error_page 503 = /server/rate-limit.html;
{%- endif -%}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment