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
0db5dba8
Commit
0db5dba8
authored
Jan 07, 2016
by
Edward Zarecor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update default, add to cms
parent
f9af54a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
playbooks/roles/nginx/defaults/main.yml
+1
-1
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms.j2
+9
-3
No files found.
playbooks/roles/nginx/defaults/main.yml
View file @
0db5dba8
...
...
@@ -23,7 +23,7 @@ NGINX_REDIRECT_TO_HTTPS: False
# This variable is only checked if NGINX_REDIRECT_TO_HTTPS is true
# It should be set to one of !!null, "scheme" or "forward_for_proto"
NGINX_HTTPS_REDIRECT_STRAGEGY
:
!!null
NGINX_HTTPS_REDIRECT_STRAGEGY
:
"
scheme"
NGINX_SSL_CERTIFICATE
:
'
ssl-cert-snakeoil.pem'
NGINX_SSL_KEY
:
'
ssl-cert-snakeoil.key'
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms.j2
View file @
0db5dba8
...
...
@@ -41,27 +41,33 @@ error_page {{ k }} {{ v }};
# request the browser to use SSL for all connections
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
{% endif %}
# 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_STRATEGEY == "scheme" %}
# Redirect http to https over single instance
if ($scheme != "https")
{
set $do_redirect_to_https "true";
}
{% endif %}
{% if NGINX_HTTPS_REDIRECT_STRATEGEY == "forward_for_proto" %}
# Nginx does not support nested conditions
# 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 %}
server_name {{ CMS_HOSTNAME }};
access_log {{ nginx_log_dir }}/access.log {{ NGINX_LOG_FORMAT_NAME }};
...
...
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