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
edx
configuration
Commits
2ff13f4b
Commit
2ff13f4b
authored
Apr 13, 2017
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed CORS for credentials
LEARNER-568
parent
01fea939
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
11 deletions
+8
-11
playbooks/roles/credentials/defaults/main.yml
+8
-4
playbooks/roles/credentials/templates/edx/app/nginx/sites-available/credentials.j2
+0
-7
No files found.
playbooks/roles/credentials/defaults/main.yml
View file @
2ff13f4b
...
...
@@ -108,12 +108,13 @@ CREDENTIALS_FILE_STORAGE_BACKEND:
STATICFILES_STORAGE
:
'
django.contrib.staticfiles.storage.ManifestStaticFilesStorage'
DEFAULT_FILE_STORAGE
:
'
django.core.files.storage.FileSystemStorage'
# Note: the protocol for CORS whitelist values is necessary for matching the correct origin by nginx
CREDENTIALS_CORS_WHITELIST_DEFAULT
:
CREDENTIALS_CORS_ORIGIN_ALLOW_ALL
:
false
CREDENTIALS_CORS_ORIGIN_WHITELIST_DEFAULT
:
-
"
{{
CREDENTIALS_DOMAIN
}}"
CREDENTIALS_CORS_WHITELIST_EXTRA
:
[]
CREDENTIALS_CORS_
WHITELIST
:
"
{{
CREDENTIALS_CORS_WHITELIST_DEFAULT
+
CREDENTIALS_CORS
_WHITELIST_EXTRA
}}"
CREDENTIALS_CORS_
ORIGIN_
WHITELIST_EXTRA
:
[]
CREDENTIALS_CORS_
ORIGIN_WHITELIST
:
"
{{
CREDENTIALS_CORS_ORIGIN_WHITELIST_DEFAULT
+
CREDENTIALS_CORS_ORIGIN
_WHITELIST_EXTRA
}}"
CREDENTIALS_VERSION
:
"
master"
CREDENTIALS_REPOS
:
...
...
@@ -179,6 +180,9 @@ CREDENTIALS_SERVICE_CONFIG:
JWT_AUTH
:
'
{{
CREDENTIALS_JWT_AUTH
}}'
CORS_ORIGIN_WHITELIST
:
'
{{
CREDENTIALS_CORS_ORIGIN_WHITELIST
}}'
CORS_ORIGIN_ALLOW_ALL
:
'
{{
CREDENTIALS_CORS_ORIGIN_ALLOW_ALL
}}'
#
# vars are namespace with the module name.
#
...
...
playbooks/roles/credentials/templates/edx/app/nginx/sites-available/credentials.j2
View file @
2ff13f4b
...
...
@@ -15,11 +15,6 @@ upstream credentials_app_server {
{% endfor %}
}
map $http_origin $cors_header {
default "";
'~*^https?://({{ CREDENTIALS_CORS_WHITELIST|join('|')|replace('.', '\.') }})$' "$http_origin";
}
server {
server_name {{ CREDENTIALS_HOSTNAME }};
...
...
@@ -44,8 +39,6 @@ server {
location ~ ^{{ CREDENTIALS_STATIC_URL }}(?P<file>.*) {
root {{ CREDENTIALS_STATIC_ROOT }};
add_header Access-Control-Allow-Origin $cors_header always;
add_header Cache-Control "max-age=31536000";
try_files /$file =404;
}
...
...
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