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
ef35970b
Commit
ef35970b
authored
Dec 30, 2013
by
John Jarvis
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #590 from edx/jarv/nginx-ssl
Jarv/nginx ssl
parents
bf9857d9
e5a500a0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
0 deletions
+54
-0
playbooks/roles/edxapp/defaults/main.yml
+3
-0
playbooks/roles/nginx/defaults/main.yml
+12
-0
playbooks/roles/nginx/tasks/main.yml
+15
-0
playbooks/roles/nginx/templates/cms.j2
+11
-0
playbooks/roles/nginx/templates/lms.j2
+10
-0
util/jenkins/create-var-file.sh
+3
-0
No files found.
playbooks/roles/edxapp/defaults/main.yml
View file @
ef35970b
...
...
@@ -83,8 +83,11 @@ EDXAPP_RABBIT_HOSTNAME: 'localhost'
EDXAPP_XML_MAPPINGS
:
{}
EDXAPP_LMS_NGINX_PORT
:
18000
EDXAPP_LMS_SSL_NGINX_PORT
:
48000
EDXAPP_LMS_PREVIEW_NGINX_PORT
:
18020
EDXAPP_CMS_NGINX_PORT
:
18010
EDXAPP_CMS_SSL_NGINX_PORT
:
48010
EDXAPP_LANG
:
'
en_US.UTF-8'
EDXAPP_TIME_ZONE
:
'
America/New_York'
...
...
playbooks/roles/nginx/defaults/main.yml
View file @
ef35970b
...
...
@@ -3,6 +3,18 @@
# Set global htaccess for nginx
NGINX_HTPASSWD_USER
:
!!null
NGINX_HTPASSWD_PASS
:
!!null
NGINX_ENABLE_SSL
:
False
# Set these to real paths on your
# filesystem, otherwise nginx will
# use a self-signed snake-oil cert
#
# To use a certificate chain add the contents
# to your certificate:
#
# cat www.example.com.crt bundle.crt > www.example.com.chained.crt
NGINX_SSL_CERTIFICATE
:
'
ssl-cert-snakeoil.pem'
NGINX_SSL_KEY
:
'
ssl-cert-snakeoil.key'
nginx_app_dir
:
"
{{
COMMON_APP_DIR
}}/nginx"
nginx_data_dir
:
"
{{
COMMON_DATA_DIR
}}/nginx"
...
...
playbooks/roles/nginx/tasks/main.yml
View file @
ef35970b
...
...
@@ -75,6 +75,21 @@
path={{ nginx_log_dir}} state=directory
owner={{ common_web_user }} group={{ common_web_user }}
-
name
:
nginx | copy ssl cert
copy
:
>
src={{ NGINX_SSL_CERTIFICATE }}
dest=/etc/ssl/certs/{{ item|basename }}
owner=root group=root mode=0644
when
:
NGINX_ENABLE_SSL and NGINX_SSL_CERTIFICATE != 'ssl-cert-snakeoil.pem'
-
name
:
nginx | copy ssl key
copy
:
>
src={{ NGINX_SSL_KEY }}
dest=/etc/ssl/private/{{ item|basename }}
owner=root group=ssl-cert mode=0640
when
:
NGINX_ENABLE_SSL and NGINX_SSL_KEY != 'ssl-cert-snakeoil.key'
# removing default link
-
name
:
nginx | Removing default nginx config and restart (enabled)
file
:
path={{ nginx_sites_enabled_dir }}/default state=absent
...
...
playbooks/roles/nginx/templates/cms.j2
View file @
ef35970b
...
...
@@ -7,7 +7,18 @@ upstream cms-backend {
server {
# CMS configuration file for nginx, templated by ansible
{% if NGINX_ENABLE_SSL %}
listen {{EDXAPP_CMS_NGINX_PORT}};
listen {{EDXAPP_CMS_SSL_NGINX_PORT}} ssl;
ssl_certificate /etc/ssl/certs/{{ NGINX_SSL_CERTIFICATE|basename }};
ssl_certificate_key /etc/ssl/private/{{ NGINX_SSL_KEY|basename }};
{% else %}
listen {{EDXAPP_CMS_NGINX_PORT}} default;
{% endif %}
server_name studio.*;
...
...
playbooks/roles/nginx/templates/lms.j2
View file @
ef35970b
...
...
@@ -7,7 +7,17 @@ upstream lms-backend {
server {
# LMS configuration file for nginx, templated by ansible
{% if NGINX_ENABLE_SSL %}
listen {{EDXAPP_LMS_NGINX_PORT}} default;
listen {{EDXAPP_LMS_SSL_NGINX_PORT}} default ssl;
ssl_certificate /etc/ssl/certs/{{ NGINX_SSL_CERTIFICATE|basename }};
ssl_certificate_key /etc/ssl/private/{{ NGINX_SSL_KEY|basename }};
{% else %}
listen {{EDXAPP_LMS_NGINX_PORT}} default;
{% endif %}
access_log {{ nginx_log_dir }}/access.log;
error_log {{ nginx_log_dir }}/error.log error;
...
...
util/jenkins/create-var-file.sh
View file @
ef35970b
...
...
@@ -3,6 +3,9 @@
cat
<<
EOF
>
$extra_vars
---
ansible_ssh_private_key_file: /var/lib/jenkins/
${
keypair
}
.pem
NGINX_ENABLE_SSL: True
EDXAPP_LMS_SSL_NGINX_PORT: 443
EDXAPP_CMS_SSL_NGINX_PORT: 443
EDXAPP_PREVIEW_LMS_BASE: preview.
${
deploy_host
}
EDXAPP_LMS_BASE:
${
deploy_host
}
EDXAPP_LMS_NGINX_PORT: 80
...
...
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