From f03e120d9e543cdb8f2b050c7fd6d96bb6d7b76b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Wed, 3 Oct 2018 09:00:04 +0200 Subject: [PATCH] Activate preview.localhost hostname This allows local access to the preview endpoints. However, they should not be used anywhere since preview.LMS_HOST is used instead. Close #77. --- configurator/templates/nginx/lms.conf | 2 +- configurator/templates/openedx/universal/lms/production.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configurator/templates/nginx/lms.conf b/configurator/templates/nginx/lms.conf index 4128242..c202a8c 100644 --- a/configurator/templates/nginx/lms.conf +++ b/configurator/templates/nginx/lms.conf @@ -8,7 +8,7 @@ server { server { listen {{ "443 ssl" if ACTIVATE_HTTPS else "80" }}; - server_name localhost {{ LMS_HOST }} preview.{{ LMS_HOST }}; + server_name localhost preview.localhost {{ LMS_HOST }} preview.{{ LMS_HOST }}; {% if ACTIVATE_HTTPS %} ssl_certificate /etc/letsencrypt/live/{{ LMS_HOST }}/fullchain.pem; diff --git a/configurator/templates/openedx/universal/lms/production.py b/configurator/templates/openedx/universal/lms/production.py index 848c409..2bbf248 100644 --- a/configurator/templates/openedx/universal/lms/production.py +++ b/configurator/templates/openedx/universal/lms/production.py @@ -28,8 +28,8 @@ PROFILE_IMAGE_BACKEND['options']['location'] = os.path.join(MEDIA_ROOT, 'profile ALLOWED_HOSTS = [ ENV_TOKENS.get('LMS_BASE'), FEATURES['PREVIEW_LMS_BASE'], - '127.0.0.1', 'localhost', - '127.0.0.1:8000', 'localhost:8000', + '127.0.0.1', 'localhost', 'preview.localhost', + '127.0.0.1:8000', 'localhost:8000', 'preview.localhost:8000', ] # Required to display all courses on start page