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
84644eaf
Commit
84644eaf
authored
9 years ago
by
Arbab Nazar
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2487 from edx/arbab/devops-3217
Fix the HTTP-to-HTTPS redirect on sandboxes
parents
e97975da
87b9f35b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
4 deletions
+39
-4
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms.j2
+6
-1
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/ecommerce.j2
+7
-1
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/insights.j2
+7
-1
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms-preview.j2
+6
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms.j2
+6
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/programs.j2
+7
-1
No files found.
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms.j2
View file @
84644eaf
...
...
@@ -91,6 +91,11 @@ error_page {{ k }} {{ v }};
{% include "robots.j2" %}
{% include "static-files.j2" %}
{% if NGINX_SET_X_FORWARDED_HEADERS %}
if ($scheme != "https") {
rewrite ^ https://$host$uri permanent;
}
{% else %}
# Forward to HTTPS if we're an HTTP request...
if ($http_x_forwarded_proto = "http") {
set $do_redirect "true";
...
...
@@ -100,5 +105,5 @@ error_page {{ k }} {{ v }};
if ($do_redirect = "true") {
rewrite ^ https://$host$request_uri? permanent;
}
{% endif %}
}
This diff is collapsed.
Click to expand it.
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/ecommerce.j2
View file @
84644eaf
...
...
@@ -53,7 +53,12 @@ location @proxy_to_app {
proxy_pass http://ecommerce_app_server;
}
# Forward to HTTPS if we're an HTTP request...
{% if NGINX_SET_X_FORWARDED_HEADERS %}
if ($scheme != "https") {
rewrite ^ https://$host$uri permanent;
}
{% else %}
# Forward to HTTPS if we're an HTTP request...
if ($http_x_forwarded_proto = "http") {
set $do_redirect "true";
}
...
...
@@ -62,5 +67,6 @@ location @proxy_to_app {
if ($do_redirect = "true") {
rewrite ^ https://$host$request_uri? permanent;
}
{% endif %}
}
This diff is collapsed.
Click to expand it.
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/insights.j2
View file @
84644eaf
...
...
@@ -33,7 +33,12 @@ location @proxy_to_app {
proxy_pass http://insights_app_server;
}
# Forward to HTTPS if we're an HTTP request...
{% if NGINX_SET_X_FORWARDED_HEADERS %}
if ($scheme != "https") {
rewrite ^ https://$host$uri permanent;
}
{% else %}
# Forward to HTTPS if we're an HTTP request...
if ($http_x_forwarded_proto = "http") {
set $do_redirect "true";
}
...
...
@@ -42,4 +47,5 @@ location @proxy_to_app {
if ($do_redirect = "true") {
rewrite ^ https://$host$request_uri? permanent;
}
{% endif %}
}
This diff is collapsed.
Click to expand it.
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms-preview.j2
View file @
84644eaf
...
...
@@ -76,6 +76,11 @@ server {
expires epoch;
}
{% if NGINX_SET_X_FORWARDED_HEADERS %}
if ($scheme != "https") {
rewrite ^ https://$host$uri permanent;
}
{% else %}
# Forward to HTTPS if we're an HTTP request...
if ($http_x_forwarded_proto = "http") {
set $do_redirect "true";
...
...
@@ -85,4 +90,5 @@ server {
if ($do_redirect = "true") {
rewrite ^ https://$host$request_uri? permanent;
}
{% endif %}
}
This diff is collapsed.
Click to expand it.
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms.j2
View file @
84644eaf
...
...
@@ -180,6 +180,11 @@ location ~ ^{{ EDXAPP_MEDIA_URL }}/(?P<file>.*) {
{% include "robots.j2" %}
{% include "static-files.j2" %}
{% if NGINX_SET_X_FORWARDED_HEADERS %}
if ($scheme != "https") {
rewrite ^ https://$host$uri permanent;
}
{% else %}
# Forward to HTTPS if we're an HTTP request...
if ($http_x_forwarded_proto = "http") {
set $do_redirect "true";
...
...
@@ -189,4 +194,5 @@ location ~ ^{{ EDXAPP_MEDIA_URL }}/(?P<file>.*) {
if ($do_redirect = "true") {
rewrite ^ https://$host$request_uri? permanent;
}
{% endif %}
}
This diff is collapsed.
Click to expand it.
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/programs.j2
View file @
84644eaf
...
...
@@ -52,7 +52,12 @@ location @proxy_to_app {
proxy_redirect off;
proxy_pass http://programs_app_server;
}
# Forward to HTTPS if we're an HTTP request...
{% if NGINX_SET_X_FORWARDED_HEADERS %}
if ($scheme != "https") {
rewrite ^ https://$host$uri permanent;
}
{% else %}
# Forward to HTTPS if we're an HTTP request...
if ($http_x_forwarded_proto = "http") {
set $do_redirect "true";
}
...
...
@@ -61,4 +66,5 @@ location @proxy_to_app {
if ($do_redirect = "true") {
rewrite ^ https://$host$request_uri? permanent;
}
{% endif %}
}
This diff is collapsed.
Click to expand it.
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