Use http_proxy_to_wsgi middleware

This sets up the HTTPProxyToWSGI middleware in front of Sahara.
The purpose of this middleware is to set up the request URL
correctly in case there is a proxy (For instance, a loadbalancer
such as HAProxy) in front of Sahara.

The HTTPProxyToWSGI is off by default and needs to be enabled
via a configuration value.

Change-Id: Ica7e8671e3880c0db90d382bec89b0994f75b36d
Closes-bug: #1590608
This commit is contained in:
Jeremy Liu 2016-10-16 23:23:54 +08:00
parent ce29d9b8ba
commit c0f43c2c5f
2 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,5 @@
[pipeline:sahara]
pipeline = cors request_id acl auth_validator sahara_api
pipeline = cors http_proxy_to_wsgi request_id acl auth_validator sahara_api
[composite:sahara_api]
use = egg:Paste#urlmap
@ -31,3 +31,6 @@ paste.filter_factory = sahara.api.middleware.auth_valid:AuthValidator.factory
[filter:debug]
paste.filter_factory = oslo_middleware.debug:Debug.factory
[filter:http_proxy_to_wsgi]
paste.filter_factory = oslo_middleware:HTTPProxyToWSGI.factory

View File

@ -7,6 +7,7 @@ namespace = oslo.db
namespace = oslo.log
namespace = oslo.messaging
namespace = oslo.middleware.cors
namespace = oslo.middleware.http_proxy_to_wsgi
namespace = oslo.policy
namespace = oslo.service.periodic_task
namespace = oslo.service.sslutils