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
ec6c027b
Commit
ec6c027b
authored
Jan 12, 2016
by
Arbab Nazar
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2689 from edx/arbab/fix-nginx-with-elif
use the elif instead of second if statement
parents
c26d5597
50ad163b
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
40 additions
and
30 deletions
+40
-30
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/analytics_api.j2
+2
-2
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms.j2
+2
-2
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/credentials.j2
+22
-12
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/ecommerce.j2
+2
-2
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/edx_notes_api.j2
+2
-2
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/insights.j2
+2
-2
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/kibana.j2
+2
-2
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms-preview.j2
+2
-2
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms.j2
+2
-2
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/programs.j2
+2
-2
No files found.
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/analytics_api.j2
View file @
ec6c027b
...
...
@@ -16,8 +16,8 @@ server {
{
set $do_redirect_to_https "true";
}
{% endif %}
{%
if NGINX_HTTPS_REDIRECT_STRATEGY == "forward_for_proto" %}
{% el
if 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")
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms.j2
View file @
ec6c027b
...
...
@@ -51,8 +51,8 @@ error_page {{ k }} {{ v }};
{
set $do_redirect_to_https "true";
}
{% endif %}
{%
if NGINX_HTTPS_REDIRECT_STRATEGY == "forward_for_proto" %}
{% el
if 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")
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/credentials.j2
View file @
ec6c027b
...
...
@@ -52,19 +52,29 @@ location @proxy_to_app {
proxy_redirect off;
proxy_pass http://credentials_app_server;
}
{% 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";
# 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" %}
# Run our actual redirect...
if ($do_redirect = "true") {
rewrite ^ https://$host$request_uri? permanent;
# 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 %}
{% endif %}
# Execute the actual redirect
if ($do_redirect_to_https = "true")
{
rewrite ^ https://$host$request_uri? permanent;
}
{% endif %}
}
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/ecommerce.j2
View file @
ec6c027b
...
...
@@ -39,8 +39,8 @@ server {
{
set $do_redirect_to_https "true";
}
{% endif %}
{%
if NGINX_HTTPS_REDIRECT_STRATEGY == "forward_for_proto" %}
{% el
if 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")
{
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/edx_notes_api.j2
View file @
ec6c027b
...
...
@@ -16,8 +16,8 @@ server {
{
set $do_redirect_to_https "true";
}
{% endif %}
{%
if NGINX_HTTPS_REDIRECT_STRATEGY == "forward_for_proto" %}
{% el
if 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")
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/insights.j2
View file @
ec6c027b
...
...
@@ -42,8 +42,8 @@ location @proxy_to_app {
{
set $do_redirect_to_https "true";
}
{% endif %}
{%
if NGINX_HTTPS_REDIRECT_STRATEGY == "forward_for_proto" %}
{% el
if 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")
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/kibana.j2
View file @
ec6c027b
...
...
@@ -32,8 +32,8 @@ server {
{
set $do_redirect_to_https "true";
}
{% endif %}
{%
if NGINX_HTTPS_REDIRECT_STRATEGY == "forward_for_proto" %}
{% el
if 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")
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms-preview.j2
View file @
ec6c027b
...
...
@@ -85,8 +85,8 @@ server {
{
set $do_redirect_to_https "true";
}
{% endif %}
{%
if NGINX_HTTPS_REDIRECT_STRATEGY == "forward_for_proto" %}
{% el
if 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")
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms.j2
View file @
ec6c027b
...
...
@@ -71,8 +71,8 @@ error_page {{ k }} {{ v }};
{
set $do_redirect_to_https "true";
}
{% endif %}
{%
if NGINX_HTTPS_REDIRECT_STRATEGY == "forward_for_proto" %}
{% el
if 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")
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/programs.j2
View file @
ec6c027b
...
...
@@ -40,8 +40,8 @@ server {
{
set $do_redirect_to_https "true";
}
{% endif %}
{%
if NGINX_HTTPS_REDIRECT_STRATEGY == "forward_for_proto" %}
{% el
if 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")
...
...
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