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
5d482993
Commit
5d482993
authored
Sep 11, 2017
by
wajeeha-khalid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
YONK-752: add j2 templates for scorm xblock static content access
parent
5ec97225
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
0 deletions
+53
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/extra_locations_lms.j2
+24
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms.j2
+1
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/static-files-extra.j2
+26
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/static-files.j2
+2
-0
No files found.
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/extra_locations_lms.j2
0 → 100644
View file @
5d482993
# The Origin request header indicates where a fetch originates from. It doesn't include any path information,
# but only the server name (e.g. https://www.example.com).
# See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin for details.
#
# Here we set the value that is included in the Access-Control-Allow-Origin response header. If the origin is one
# of our known hosts--served via HTTP or HTTPS--we allow for CORS. Otherwise, we set the "null" value, disallowing CORS.
map $http_origin $cors_origin {
default "null";
{% for host in CORS_ORIGIN_WHITELIST %}
"~*^https?:\/\/{{ host|replace('.', '\.') }}$" $http_origin;
{% endfor %}
}
location ~ ^/{{ EDXAPP_MEDIA_URL }}/{{ XBLOCK_SETTINGS.ScormXBlock.SCORM_PKG_STORAGE_DIR }}/(?P<file>.*) {
add_header 'Access-Control-Allow-Origin' $cors_origin;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
root {{ edxapp_media_dir }}/{{ XBLOCK_SETTINGS.ScormXBlock.SCORM_PKG_STORAGE_DIR }};
try_files /$file =404;
expires 31536000s;
}
\ No newline at end of file
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms.j2
View file @
5d482993
...
...
@@ -282,5 +282,6 @@ location ~ ^{{ EDXAPP_MEDIA_URL }}/(?P<file>.*) {
{% include "robots.j2" %}
{% include "static-files.j2" %}
{% include "extra_locations_lms.j2" ignore missing %}
}
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/static-files-extra.j2
0 → 100644
View file @
5d482993
# The Origin request header indicates where a fetch originates from. It doesn't include any path information,
# but only the server name (e.g. https://www.example.com).
# See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin for details.
#
# Here we set the value that is included in the Access-Control-Allow-Origin response header. If the origin is one
# of our known hosts--served via HTTP or HTTPS--we allow for CORS. Otherwise, we set the "null" value, disallowing CORS.
map $http_origin $cors_origin {
default "null";
{% for host in CORS_ORIGIN_WHITELIST %}
"~*^https?:\/\/{{ host|replace('.', '\.') }}$" $http_origin;
{% endfor %}
}
# w/in scorm/, override default return 403 for these file types
location ~ ^/static/scorm/(?:.*)(?:\.xml|\.json) {
try_files /{{ XBLOCK_SETTINGS.ScormXBlock.SCORM_PLAYER_LOCAL_STORAGE_ROOT }}/$file =404;
}
location ~ "/scorm/(?P<file>.*)" {
add_header 'Access-Control-Allow-Origin' $cors_origin;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
try_files /{{ XBLOCK_SETTINGS.ScormXBlock.SCORM_PLAYER_LOCAL_STORAGE_ROOT }}/$file =404;
}
\ No newline at end of file
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/static-files.j2
View file @
5d482993
...
...
@@ -38,6 +38,8 @@
try_files /staticfiles/$collected /course_static/$collected =404;
}
{% include "static-files-extra.j2" ignore missing %}
# Expire other static files immediately (there should be very few / none of these)
expires 300;
}
...
...
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