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
707382c7
Commit
707382c7
authored
Nov 14, 2017
by
nadeemshahzad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable HSTS even behind the ELB
parent
8ed15884
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
5 deletions
+24
-5
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
+6
-0
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.
playbooks/roles/nginx/defaults/main.yml
View file @
707382c7
...
...
@@ -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 @
707382c7
...
...
@@ -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 @
707382c7
...
...
@@ -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 @
707382c7
...
...
@@ -13,6 +13,12 @@ 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={{ NGINX_HSTS_MAX_AGE }}";
{% endif %}
# request the browser to use SSL for all connections
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
{% endif %}
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/insights.j2
View file @
707382c7
...
...
@@ -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 @
707382c7
...
...
@@ -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