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
81e7f58d
Commit
81e7f58d
authored
Sep 03, 2014
by
Feanil Patel
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1512 from edx/feanil/nginx_rate_limiting
Feanil/nginx rate limiting
parents
ad56d9fe
590bf5f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
playbooks/roles/edxapp/defaults/main.yml
+5
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms.j2
+15
-0
No files found.
playbooks/roles/edxapp/defaults/main.yml
View file @
81e7f58d
...
...
@@ -147,6 +147,11 @@ EDXAPP_LMS_PREVIEW_NGINX_PORT: 18020
EDXAPP_CMS_NGINX_PORT
:
18010
EDXAPP_CMS_SSL_NGINX_PORT
:
48010
# NGINX Rate limiting related vars
EDXAPP_ENABLE_RATE_LIMITING
:
false
EDXAPP_COURSE_REQUEST_RATE
:
'
5r/s'
EDXAPP_COURSE_REQUEST_BURST_RATE
:
10
EDXAPP_LANG
:
'
en_US.UTF-8'
EDXAPP_LANGUAGE_CODE
:
'
en'
EDXAPP_TIME_ZONE
:
'
America/New_York'
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms.j2
View file @
81e7f58d
...
...
@@ -10,6 +10,11 @@ upstream lms-backend {
{% endfor %}
}
{%- if EDXAPP_ENABLE_RATE_LIMITING -%}
# Make Zone
limit_req_zone $cookie_{{ EDXAPP_SESSION_COOKIE_NAME }} zone=cookies:10m rate={{ EDXAPP_COURSES_REQUEST_RATE }};
{%- endif -%}
server {
# LMS configuration file for nginx, templated by ansible
...
...
@@ -68,6 +73,16 @@ server {
try_files $uri @proxy_to_lms_app;
}
location /courses {
{%- if EDXAPP_ENABLE_RATE_LIMITING -%}
# Set Limit
limit_req zone=cookies burst={{ EDXAPP_COURSE_REQUEST_BURST_RATE }};
{%- endif -%}
{%- include "basic-auth.j2" %}
try_files $uri @proxy_to_lms_app;
}
{% include "robots.j2" %}
{% include "static-files.j2" %}
...
...
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