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
a1b75e59
Commit
a1b75e59
authored
Apr 07, 2016
by
Clinton Blackburn
Committed by
Clinton Blackburn
May 03, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing discovery for sandboxes
ECOM-3877
parent
9cd01744
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
1 deletions
+90
-1
playbooks/edx-east/edx_continuous_integration.yml
+2
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/discovery.j2
+86
-0
util/jenkins/ansible-provision.sh
+2
-1
No files found.
playbooks/edx-east/edx_continuous_integration.yml
View file @
a1b75e59
...
...
@@ -19,6 +19,7 @@
-
ecommerce
-
programs
-
credentials
-
discovery
nginx_default_sites
:
-
lms
-
mysql
...
...
@@ -42,6 +43,7 @@
-
ecommerce
-
programs
-
credentials
-
discovery
-
oauth_client_setup
-
role
:
datadog
when
:
COMMON_ENABLE_DATADOG
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/discovery.j2
0 → 100644
View file @
a1b75e59
#
# {{ ansible_managed }}
#
{% if nginx_default_sites is defined and "discovery" in nginx_default_sites %}
{% set default_site = "default" %}
{% else %}
{% set default_site = "" %}
{% endif %}
upstream discovery_app_server {
{% for host in nginx_discovery_gunicorn_hosts %}
server {{ host }}:{{ discovery_gunicorn_port }} fail_timeout=0;
{% endfor %}
}
server {
server_name {{ DISCOVERY_HOSTNAME }};
{% if NGINX_ENABLE_SSL %}
listen {{ DISCOVERY_NGINX_PORT }} {{ default_site }};
listen {{ DISCOVERY_SSL_NGINX_PORT }} ssl;
ssl_certificate /etc/ssl/certs/{{ NGINX_SSL_CERTIFICATE|basename }};
ssl_certificate_key /etc/ssl/private/{{ NGINX_SSL_KEY|basename }};
# request the browser to use SSL for all connections
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
{% else %}
listen {{ DISCOVERY_NGINX_PORT }} {{ default_site }};
{% endif %}
location ~ ^/static/(?P<file>.*) {
root {{ COMMON_DATA_DIR }}/{{ discovery_service_name }};
try_files /staticfiles/$file =404;
}
location / {
try_files $uri @proxy_to_app;
}
{% include "robots.j2" %}
location @proxy_to_app {
{% if NGINX_SET_X_FORWARDED_HEADERS %}
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $remote_addr;
{% else %}
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Forwarded-Port $http_x_forwarded_port;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
{% endif %}
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://discovery_app_server;
}
# Nginx does not support nested condition or or conditions so
# there is an unfortunate mix of conditonals here.
{% if NGINX_REDIRECT_TO_HTTPS %}
{% if NGINX_HTTPS_REDIRECT_STRATEGY == "scheme" %}
# Redirect http to https over single instance
if ($scheme != "https")
{
set $do_redirect_to_https "true";
}
{% elif NGINX_HTTPS_REDIRECT_STRATEGY == "forward_for_proto" %}
# Forward to HTTPS if we're an HTTP request... and the server is behind ELB
if ($http_x_forwarded_proto = "http")
{
set $do_redirect_to_https "true";
}
{% endif %}
# Execute the actual redirect
if ($do_redirect_to_https = "true")
{
rewrite ^ https://$host$request_uri? permanent;
}
{% endif %}
}
util/jenkins/ansible-provision.sh
View file @
a1b75e59
...
...
@@ -195,6 +195,7 @@ CREDENTIALS_VERSION: $credentials_version
DISCOVERY_NGINX_PORT: 80
DISCOVERY_SSL_NGINX_PORT: 443
DISCOVERY_VERSION:
$discovery_version
NGINX_SET_X_FORWARDED_HEADERS: True
NGINX_REDIRECT_TO_HTTPS: True
EDX_ANSIBLE_DUMP_VARS: true
...
...
@@ -288,8 +289,8 @@ CREDENTIALS_LMS_URL_ROOT: "https://${deploy_host}"
CREDENTIALS_DOMAIN: "credentials-
${
deploy_host
}
"
CREDENTIALS_URL_ROOT: "http://{{ CREDENTIALS_DOMAIN }}"
CREDENTIALS_SOCIAL_AUTH_REDIRECT_IS_HTTPS: true
COURSE_DISCOVERY_ECOMMERCE_API_URL: "https://ecommerce-
${
deploy_host
}
/api/v2"
DISCOVERY_ECOMMERCE_API_URL: "{{ ECOMMERCE_ECOMMERCE_URL_ROOT }}/api/v2"
DISCOVERY_URL_ROOT: "https://discovery-
${
deploy_host
}
"
DISCOVERY_SOCIAL_AUTH_REDIRECT_IS_HTTPS: true
...
...
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