From 46620ea447930dc592077aef763f2e435260b15c Mon Sep 17 00:00:00 2001 From: "shashi.kant" Date: Mon, 10 Oct 2016 15:49:24 +0530 Subject: [PATCH] Set HTTPProxyTOWSGI middleware in front of congress. The purpose of this middleware is to set up the request URL correctly in case there is a proxy in front of congress. The HTTPProxyToWSGI is off by default and needs to be enabled via a configuration value. Change-Id: Ib0aaebbd42daa94e93ba1daefd3e84241f95e92a --- etc/api-paste.ini | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/etc/api-paste.ini b/etc/api-paste.ini index 39be570b5..f07e9222e 100644 --- a/etc/api-paste.ini +++ b/etc/api-paste.ini @@ -4,15 +4,15 @@ use = egg:Paste#urlmap /v1: congress_api_v1 [pipeline:congressversions] -pipeline = cors catch_errors congressversionapp +pipeline = cors http_proxy_to_wsgi catch_errors congressversionapp [app:congressversionapp] paste.app_factory = congress.api.versions:Versions.factory [composite:congress_api_v1] use = call:congress.auth:pipeline_factory -keystone = cors request_id catch_errors authtoken keystonecontext congress_api -noauth = cors request_id catch_errors congress_api +keystone = cors http_proxy_to_wsgi request_id catch_errors authtoken keystonecontext congress_api +noauth = cors http_proxy_to_wsgi request_id catch_errors congress_api [app:congress_api] paste.app_factory = congress.service:congress_app_factory @@ -32,3 +32,7 @@ paste.filter_factory = keystonemiddleware.auth_token:filter_factory [filter:cors] paste.filter_factory = oslo_middleware.cors:filter_factory oslo_config_project = congress + +[filter:http_proxy_to_wsgi] +paste.filter_factory = oslo_middleware.http_proxy_to_wsgi:HTTPProxyToWSGI.factory +oslo_config_project = congress