From 2d4fbffb919884a8f9fb6ba690756cefd61929c7 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Tue, 7 Aug 2018 10:07:06 -0400 Subject: [PATCH] set the correct X-Forwarded-Port header to fix SAML auth see: https://github.com/ansible/tower/issues/2314 --- installer/roles/image_build/files/nginx.conf | 1 + installer/roles/image_build/files/settings.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/installer/roles/image_build/files/nginx.conf b/installer/roles/image_build/files/nginx.conf index 391722ea70..a845fed37e 100644 --- a/installer/roles/image_build/files/nginx.conf +++ b/installer/roles/image_build/files/nginx.conf @@ -77,6 +77,7 @@ http { uwsgi_read_timeout 120s; uwsgi_pass uwsgi; include /etc/nginx/uwsgi_params; + proxy_set_header X-Forwarded-Port 443; } } } diff --git a/installer/roles/image_build/files/settings.py b/installer/roles/image_build/files/settings.py index 4062d9a69a..c9f459283a 100644 --- a/installer/roles/image_build/files/settings.py +++ b/installer/roles/image_build/files/settings.py @@ -108,3 +108,5 @@ CACHES = { 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', }, } + +USE_X_FORWARDED_PORT = True