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
eda2f139
Unverified
Commit
eda2f139
authored
Nov 15, 2017
by
Nadeem Shahzad
Committed by
GitHub
Nov 15, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4206 from edx/nadeem/OPS-2412
Enable HTTP Strict Transport Security even behind the ELB
parents
35778117
1d7dbee1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
6 deletions
+26
-6
CHANGELOG.md
+4
-0
playbooks/roles/nginx/defaults/main.yml
+1
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms.j2
+4
-1
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/credentials.j2
+5
-2
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/edx_notes_api.j2
+4
-1
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/insights.j2
+4
-1
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms.j2
+4
-1
No files found.
CHANGELOG.md
View file @
eda2f139
-
Role: nginx
-
Modified
`lms.j2`
,
`cms.j2`
,
`credentials.j2`
,
`edx_notes_api.j2`
and
`insights.j2`
to enable HTTP Strict Transport Security
-
Added
`NGINX_HSTS_MAX_AGE`
to make HSTS header
`max_age`
value configurable and used in templates
-
Role: server_utils
-
Install "vim", not "vim-tiny".
...
...
playbooks/roles/nginx/defaults/main.yml
View file @
eda2f139
...
...
@@ -18,6 +18,7 @@ NGINX_USERS:
NGINX_ENABLE_SSL
:
False
NGINX_REDIRECT_TO_HTTPS
:
False
NGINX_HSTS_MAX_AGE
:
31536000
# Set these to real paths on your
# filesystem, otherwise nginx will
# use a self-signed snake-oil cert
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms.j2
View file @
eda2f139
...
...
@@ -38,8 +38,11 @@ error_page {{ k }} {{ v }};
ssl_certificate /etc/ssl/certs/{{ NGINX_SSL_CERTIFICATE|basename }};
ssl_certificate_key /etc/ssl/private/{{ NGINX_SSL_KEY|basename }};
{% endif %}
{% if NGINX_ENABLE_SSL or NGINX_REDIRECT_TO_HTTPS %}
# request the browser to use SSL for all connections
add_header Strict-Transport-Security "max-age=
31536000; includeSubDomains
";
add_header Strict-Transport-Security "max-age=
{{ NGINX_HSTS_MAX_AGE }}
";
{% endif %}
# Prevent invalid display courseware in IE 10+ with high privacy settings
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/credentials.j2
View file @
eda2f139
...
...
@@ -27,12 +27,15 @@ server {
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 {{ CREDENTIALS_NGINX_PORT }} {{ default_site }};
{% endif %}
{% if NGINX_ENABLE_SSL or NGINX_REDIRECT_TO_HTTPS %}
# request the browser to use SSL for all connections
add_header Strict-Transport-Security "max-age={{ NGINX_HSTS_MAX_AGE }}";
{% endif %}
# Prevent invalid display courseware in IE 10+ with high privacy settings
add_header P3P '{{ NGINX_P3P_MESSAGE }}';
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/edx_notes_api.j2
View file @
eda2f139
...
...
@@ -13,8 +13,11 @@ server {
ssl_certificate /etc/ssl/certs/{{ NGINX_SSL_CERTIFICATE|basename }};
ssl_certificate_key /etc/ssl/private/{{ NGINX_SSL_KEY|basename }};
{% endif %}
{% if NGINX_ENABLE_SSL or NGINX_REDIRECT_TO_HTTPS %}
# request the browser to use SSL for all connections
add_header Strict-Transport-Security "max-age=
31536000; includeSubDomains
";
add_header Strict-Transport-Security "max-age=
{{ NGINX_HSTS_MAX_AGE }}
";
{% endif %}
{% include "common-settings.j2" %}
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/insights.j2
View file @
eda2f139
...
...
@@ -27,8 +27,11 @@ server {
ssl_certificate /etc/ssl/certs/{{ NGINX_SSL_CERTIFICATE|basename }};
ssl_certificate_key /etc/ssl/private/{{ NGINX_SSL_KEY|basename }};
{% endif %}
{% if NGINX_ENABLE_SSL or NGINX_REDIRECT_TO_HTTPS %}
# request the browser to use SSL for all connections
add_header Strict-Transport-Security "max-age=
31536000; includeSubDomains
";
add_header Strict-Transport-Security "max-age=
{{ NGINX_HSTS_MAX_AGE }}
";
{% endif %}
location ~ ^/static/(?P<file>.*) {
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms.j2
View file @
eda2f139
...
...
@@ -86,8 +86,11 @@ error_page {{ k }} {{ v }};
ssl_certificate /etc/ssl/certs/{{ NGINX_SSL_CERTIFICATE|basename }};
ssl_certificate_key /etc/ssl/private/{{ NGINX_SSL_KEY|basename }};
{% endif %}
{% if NGINX_ENABLE_SSL or NGINX_REDIRECT_TO_HTTPS %}
# request the browser to use SSL for all connections
add_header Strict-Transport-Security "max-age=
31536000; includeSubDomains
";
add_header Strict-Transport-Security "max-age=
{{ NGINX_HSTS_MAX_AGE }}
";
{% endif %}
# Prevent invalid display courseware in IE 10+ with high privacy settings
...
...
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