Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
b649633a
Commit
b649633a
authored
Oct 05, 2016
by
syed-awais-ali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added comments
parent
be321461
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletions
+12
-1
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms.j2
+12
-1
No files found.
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms.j2
View file @
b649633a
...
@@ -14,11 +14,22 @@ upstream lms-backend {
...
@@ -14,11 +14,22 @@ upstream lms-backend {
{%- if EDXAPP_ENABLE_RATE_LIMITING -%}
{%- if EDXAPP_ENABLE_RATE_LIMITING -%}
# Make Zone
# 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={{ EDXAPP_COURSES_REQUEST_RATE }};
#Iterate through the list of User agent and add limit_req_zone for each user agent
# Iterate through the list of User agent and add limit_req_zone for each user agent
{% for agent in EDXAPP_RATE_LIMITED_USER_AGENTS %}
{% for agent in EDXAPP_RATE_LIMITED_USER_AGENTS %}
# Map directive is used in the configuration. Map is used to create a variable
# whose value depends on other variable. So here Map is used actually to
# dynamically have different rate limits for different user agents
map $http_user_agent {{ "$limit_bot_" ~ agent.alias }} {
map $http_user_agent {{ "$limit_bot_" ~ agent.alias }} {
{{ agent.agent_name }} $binary_remote_addr;
{{ agent.agent_name }} $binary_remote_addr;
}
}
# Limit_req_zone for each user agent in EDXAPP_RATE_LIMITED_USER_AGENTS list
limit_req_zone {{ "$limit_bot_" ~ agent.alias }} zone=agents:10m rate={{ agent.rate }};
limit_req_zone {{ "$limit_bot_" ~ agent.alias }} zone=agents:10m rate={{ agent.rate }};
{% endfor %}
{% endfor %}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment