Adding ability to read proxy headers for proper url build.

Change-Id: Icbc74a56f375c76595f6d901dd32354d61673b0d
diff --git a/README.rst b/README.rst
index 4ef4bbe..6c32a71 100644
--- a/README.rst
+++ b/README.rst
@@ -41,6 +41,7 @@
         admin_name: admin
         admin_password: 'adminpwd'
         admin_email: stackmaster@domain.com
+        enable_proxy_headers_parsing: True
         roles:
           - admin
           - Member
diff --git a/keystone/files/newton/keystone.conf.Debian b/keystone/files/newton/keystone.conf.Debian
index ab8a7f3..8d22cf4 100644
--- a/keystone/files/newton/keystone.conf.Debian
+++ b/keystone/files/newton/keystone.conf.Debian
@@ -2257,6 +2257,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/keystone/files/ocata/keystone.conf.Debian b/keystone/files/ocata/keystone.conf.Debian
index 2abacd6..a2c50eb 100644
--- a/keystone/files/ocata/keystone.conf.Debian
+++ b/keystone/files/ocata/keystone.conf.Debian
@@ -2427,6 +2427,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/keystone/files/pike/keystone.conf.Debian b/keystone/files/pike/keystone.conf.Debian
index 760240b..4f3ef6d 100644
--- a/keystone/files/pike/keystone.conf.Debian
+++ b/keystone/files/pike/keystone.conf.Debian
@@ -2441,6 +2441,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/apache_wsgi.sls b/tests/pillar/apache_wsgi.sls
index 3de3095..880b53d 100644
--- a/tests/pillar/apache_wsgi.sls
+++ b/tests/pillar/apache_wsgi.sls
@@ -11,6 +11,7 @@
     admin_name: admin
     admin_password: passw0rd
     admin_email: root@localhost
+    enable_proxy_headers_parsing: True
     bind:
       address: 0.0.0.0
       private_address: 127.0.0.1