From 156662e5e2c608ff62e14d5a24bbe3fe74e280bd Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Mon, 25 Jan 2016 16:47:43 +0000 Subject: [PATCH] pdc, conditional server name for prod and stg. --- roles/pdc/frontend/templates/pdc.conf | 5 +++++ roles/pdc/frontend/templates/settings_local.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/roles/pdc/frontend/templates/pdc.conf b/roles/pdc/frontend/templates/pdc.conf index 4cd2f9c95a..8703bef2ea 100644 --- a/roles/pdc/frontend/templates/pdc.conf +++ b/roles/pdc/frontend/templates/pdc.conf @@ -11,7 +11,12 @@ WSGIScriptAlias / /usr/lib/python2.7/site-packages/pdc/wsgi.py + {% if env == 'staging' %} ServerName https://pdc.stg.fedoraproject.org + {% else %} + ServerName https://pdc.fedoraproject.org + {% endif %} + UseCanonicalName on RewriteEngine on diff --git a/roles/pdc/frontend/templates/settings_local.py b/roles/pdc/frontend/templates/settings_local.py index 71422fe22e..2d021a5206 100644 --- a/roles/pdc/frontend/templates/settings_local.py +++ b/roles/pdc/frontend/templates/settings_local.py @@ -67,6 +67,11 @@ DEBUG = False # NOTE: this is needed when DEGUB is False. # https://docs.djangoproject.com/en/1.8/ref/settings/#allowed-hosts ALLOWED_HOSTS = [ + {% if env == 'staging' %} + 'pdc.stg.fedoraproject.org', + {% else %} + 'pdc.fedoraproject.org', + {% endif %} '{{ inventory_hostname }}', '{{ inventory_hostname_short }}', 'localhost',