Enable HAProxy forwardfor option for Horizon.
authorDimitri Savineau <dsavinea@redhat.com>
Wed, 23 Mar 2016 14:14:30 +0000 (10:14 -0400)
committerDimitri Savineau <dsavinea@redhat.com>
Fri, 15 Apr 2016 15:12:19 +0000 (11:12 -0400)
Horizon's backends (httpd) see IP address of the haproxy in the logs instead
of the client address.
Adding forwardfor option allows to add the client address to the
X-Forwarded-For HTTP header and can be replace in the logs by configured the
backend servers with this header.

Change-Id: I54f0f5549d64768dacca71539c71a28cc99d9d95

manifests/loadbalancer.pp

index f9d0473..70ccbc1 100644 (file)
@@ -520,6 +520,7 @@ class tripleo::loadbalancer (
       'rsprep'   => '^Location:\ http://(.*) Location:\ https://\1',
       # NOTE(jaosorior): We always redirect to https for the public_virtual_ip.
       'redirect' => "scheme https code 301 if { hdr(host) -i ${public_virtual_ip} } !{ ssl_fc }",
+      'option'   => 'forwardfor',
     }
   } else {
     $horizon_bind_opts = {
@@ -528,6 +529,7 @@ class tripleo::loadbalancer (
     }
     $horizon_options = {
       'cookie' => 'SERVERID insert indirect nocache',
+      'option' => 'forwardfor',
     }
   }