Skip to content

Latest commit

 

History

History
executable file
·
43 lines (26 loc) · 3.11 KB

nginx_configuration.md

File metadata and controls

executable file
·
43 lines (26 loc) · 3.11 KB

Steps

In order to support an external SCORM player such as the SSLA player, additional Nginx configuration is needed.

  • The files /edx/app/nginx/sites-enabled/lms and /edx/app/nginx/sites-enabled/lms are generated by the Nginx Ansible role at /edx/app/edx_ansible/edx_ansible/playbooks/roles/nginx from the configuration repository https://github.com/edx/configuration. The lms and cms Nginx configuration files are generated from Jinja2 lms.j2 and cms.j2 templates in /edx/app/edx_ansible/edx_ansible/playbooks/roles/nginx/templates/edx/app/nginx/sites-available directory.

Copy the included files from this repo

  • Copy the files to include, extra_locations_lms.j2 and static-files-extra.j2 into the /edx/app/edx_ansible/edx_ansible/playbooks/roles/nginx/templates/edx/app/nginx/sites-available directory. (Appsembler's fork of /edx/configuration adds these files to the .gitignore file so they will not interfere with subsequent git pulls.)

Add include statements to default Nginx j2 templates

  • Add Nginx include statements to pull in your own external .j2 templates, following instructions below. (Appsembler has added these include statements to our fork of edx/configuration

    • Edit /edx/app/edx_ansible/edx_ansible/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms.j2. Add the following just below {% include "static-files.j2" %} and just above the last closing }.
      {% include "extra_locations_lms.j2" ignore missing %}
    
    • Edit /edx/app/edx_ansible/edx_ansible/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/static-files.j2. Add the following just above expires epoch:
        {% include "static-files-extra.j2" ignore missing %}
    
    • You do not need to edit cms.j2.

Note: If your configuration directory (edx_ansible/edx_ansible) on the server is checked out from GitHub, as it most likely is, these two files will be marked as modified and will cause further git pulls from /edx/configuration to fail when running /edx/bin/update or otherwise running any Ansible playbook which pulls updates from GitHub to the edx_ansible code directory. (not relevant for Appsembler's fork of /edx/configuration)

Run Ansible Nginx role

  • Once you have done this, rerun the Nginx Ansible role for the LMS and CMS sites with this commands on your edxapp server.

    • sudo /edx/app/edx_ansible/venvs/edx_ansible/bin/ansible-playbook -i localhost, -c local /edx/app/edx_ansible/edx_ansible/playbooks/run_role.yml -e"role=nginx" -e"@/edx/app/edx_ansible/edx_ansible/playbooks/roles/edxapp/defaults/main.yml" -e"@/edx/app/edx_ansible/server-vars.yml" -e'{"nginx_sites":["lms", "cms"], "nginx_default_sites": ["lms"]}' -t install:configuration -vvv
  • This will update the lms and cms configuration on Nginx and should reload the Nginx configuration. To make sure you have the new configuration in place,:

sudo service nginx configtest
sudo service nginx reload

You should now be able to use the SCORM XBlock.