Add passing of X-Forwarded-Proto to Glance API endpoint
authorJuan Antonio Osorio Robles <jaosorior@redhat.com>
Fri, 5 Aug 2016 08:21:23 +0000 (11:21 +0300)
committerJuan Antonio Osorio Robles <jaosorior@redhat.com>
Fri, 5 Aug 2016 08:21:23 +0000 (11:21 +0300)
Glance supports the http_proxy_to_wsgi middlware, and it was recently
enabled in the overcloud [1]. However, for it to work properly, we
need to add the X-Forwarded-Proto header which was missing from the
HAProxy configuration.

[1] I4a8f7fc079ca93c50aa0ef7b0548dc64f6c5cfa0

Change-Id: I82e2db1145b0476cec27676fdfbb97e86cbd8182

manifests/haproxy.pp

index 407fbb7..4e82a8b 100644 (file)
@@ -593,6 +593,12 @@ class tripleo::haproxy (
       ip_addresses      => hiera('glance_api_node_ips', $controller_hosts_real),
       server_names      => $controller_hosts_names_real,
       public_ssl_port   => $ports[glance_api_ssl_port],
+      mode              => 'http',
+      listen_options    => {
+          'http-request' => [
+            'set-header X-Forwarded-Proto https if { ssl_fc }',
+            'set-header X-Forwarded-Proto http if !{ ssl_fc }'],
+      },
     }
   }