Add http_proxy_to_wsgi to api-paste

This sets up the HTTPProxyToWSGI middleware in front of Nova-API. The
purpose of thise 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 Nova.

So, for instance, when TLS connections are being terminated in the
proxy, and one tries to get the versions from the / resource of
Nova, one will notice that the protocol is incorrect; It will show
'http' instead of 'https'. So this middleware handles such cases.
Thus helping Keystone discovery work correctly.

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

Change-Id: Ia78f73e96585ab33a379a0b0be6d9682f7fbd810
Closes-Bug: #1573766
This commit is contained in:
Juan Antonio Osorio Robles 2016-05-19 15:10:22 +03:00
parent fe8a119e8d
commit b609a3b32e

View File

@ -51,6 +51,9 @@ paste.filter_factory = nova.api.openstack.auth:NoAuthMiddleware.factory
[filter:sizelimit]
paste.filter_factory = oslo_middleware:RequestBodySizeLimiter.factory
[filter:http_proxy_to_wsgi]
paste.filter_factory = oslo_middleware.http_proxy_to_wsgi:HTTPProxyToWSGI.factory
[filter:legacy_v2_compatible]
paste.filter_factory = nova.api.openstack:LegacyV2CompatibleWrapper.factory
@ -61,7 +64,7 @@ paste.app_factory = nova.api.openstack.compute:APIRouter.factory
paste.app_factory = nova.api.openstack.compute:APIRouterV21.factory
[pipeline:oscomputeversions]
pipeline = faultwrap oscomputeversionapp
pipeline = faultwrap http_proxy_to_wsgi oscomputeversionapp
[app:oscomputeversionapp]
paste.app_factory = nova.api.openstack.compute.versions:Versions.factory