Adding ability to read proxy headers for proper url build.
+ README example fix

Change-Id: I1187e9e38e48e9ea3a32c3a53a284734b288306e
diff --git a/README.rst b/README.rst
index 78c5538..23012c6 100644
--- a/README.rst
+++ b/README.rst
@@ -21,37 +21,38 @@
         version: mitaka
         ttl: 86400
         cluster: true
-      database:
-        engine: "mysql+pymysql"
-        host: 10.0.106.20
-        port: 3306
-        name: aodh
-        user: aodh
-        password: password
-      bind:
-        host: 10.0.106.20
-        port: 8042
-      identity:
-        engine: keystone
-        host: 10.0.106.20
-        port: 35357
-        tenant: service
-        user: aodh
-        password: password
-      message_queue:
-        engine: rabbitmq
-        port: 5672
-        user: openstack
-        password: password
-        virtual_host: '/openstack'
-      cache:
-        members:
-        - host: 10.10.10.10
-            port: 11211
-        - host: 10.10.10.11
-            port: 11211
-        - host: 10.10.10.12
-            port: 11211
+        enable_proxy_headers_parsing: True
+        database:
+          engine: "mysql+pymysql"
+          host: 10.0.106.20
+          port: 3306
+          name: aodh
+          user: aodh
+          password: password
+        bind:
+          host: 10.0.106.20
+          port: 8042
+        identity:
+          engine: keystone
+          host: 10.0.106.20
+          port: 35357
+          tenant: service
+          user: aodh
+          password: password
+        message_queue:
+          engine: rabbitmq
+          port: 5672
+          user: openstack
+          password: password
+          virtual_host: '/openstack'
+        cache:
+          members:
+          - host: 10.10.10.10
+              port: 11211
+          - host: 10.10.10.11
+              port: 11211
+          - host: 10.10.10.12
+              port: 11211
 
 Setting alarm history cleanup
 
diff --git a/aodh/files/newton/aodh.conf.Debian b/aodh/files/newton/aodh.conf.Debian
index 8c992d1..0626c3a 100644
--- a/aodh/files/newton/aodh.conf.Debian
+++ b/aodh/files/newton/aodh.conf.Debian
@@ -1626,6 +1626,9 @@
 # Whether the application is behind a proxy or not. This determines if the
 # middleware should parse the headers or not. (boolean value)
 #enable_proxy_headers_parsing = false
+{%- if server.enable_proxy_headers_parsing is defined %}
+enable_proxy_headers_parsing = {{ server.enable_proxy_headers_parsing }}
+{%- endif %}
 
 
 [oslo_policy]
diff --git a/aodh/files/ocata/aodh.conf.Debian b/aodh/files/ocata/aodh.conf.Debian
index 8c992d1..0626c3a 100644
--- a/aodh/files/ocata/aodh.conf.Debian
+++ b/aodh/files/ocata/aodh.conf.Debian
@@ -1626,6 +1626,9 @@
 # Whether the application is behind a proxy or not. This determines if the
 # middleware should parse the headers or not. (boolean value)
 #enable_proxy_headers_parsing = false
+{%- if server.enable_proxy_headers_parsing is defined %}
+enable_proxy_headers_parsing = {{ server.enable_proxy_headers_parsing }}
+{%- endif %}
 
 
 [oslo_policy]
diff --git a/aodh/files/pike/aodh.conf.Debian b/aodh/files/pike/aodh.conf.Debian
index fcbeafc..e0b3ccd 100644
--- a/aodh/files/pike/aodh.conf.Debian
+++ b/aodh/files/pike/aodh.conf.Debian
@@ -1664,6 +1664,9 @@
 # Whether the application is behind a proxy or not. This determines if the
 # middleware should parse the headers or not. (boolean value)
 #enable_proxy_headers_parsing = false
+{%- if server.enable_proxy_headers_parsing is defined %}
+enable_proxy_headers_parsing = {{ server.enable_proxy_headers_parsing }}
+{%- endif %}
 
 
 [oslo_policy]
diff --git a/tests/pillar/server_cluster.sls b/tests/pillar/server_cluster.sls
index 549f916..e25b502 100644
--- a/tests/pillar/server_cluster.sls
+++ b/tests/pillar/server_cluster.sls
@@ -6,6 +6,7 @@
     cluster: true
     ttl: 86400
     event_alarm_topic: alarm.all
+    enable_proxy_headers_parsing: True
     bind:
       host: 127.0.0.1
       port: 8042