diff --git a/playbooks/include/proxies-reverseproxy.yml b/playbooks/include/proxies-reverseproxy.yml index 4825f9bd6a..e029b30db7 100644 --- a/playbooks/include/proxies-reverseproxy.yml +++ b/playbooks/include/proxies-reverseproxy.yml @@ -455,6 +455,7 @@ destname: qa-stg-phab # Talk directly to the app server, not haproxy proxyurl: http://phab.qa-stg01.qa.fedoraproject.org + keephost: true when: env == "staging" - role: httpd/reverseproxy diff --git a/roles/httpd/reverseproxy/tasks/main.yml b/roles/httpd/reverseproxy/tasks/main.yml index c4fa7bb0c0..bb69f55c11 100644 --- a/roles/httpd/reverseproxy/tasks/main.yml +++ b/roles/httpd/reverseproxy/tasks/main.yml @@ -4,6 +4,7 @@ # - remotepath.. # - proxyurl # - rewrite +# - keephost - name: Copy in ProxyPassReverse for {{destname}} ({{website}}{{remotepath}}) template: > diff --git a/roles/httpd/reverseproxy/templates/reversepassproxy.conf b/roles/httpd/reverseproxy/templates/reversepassproxy.conf index 4304709d4c..b7d6ff06d0 100644 --- a/roles/httpd/reverseproxy/templates/reversepassproxy.conf +++ b/roles/httpd/reverseproxy/templates/reversepassproxy.conf @@ -9,5 +9,10 @@ RequestHeader set X-Scheme https early RequestHeader set X-Forwarded-Proto https early {% endif %} + +{% if keephost %} +ProxyPreserveHost On +{% endif %} + ProxyPass {{ localpath }} {{ proxyurl }}{{remotepath}} ProxyPassReverse {{ localpath }} {{ proxyurl }}{{remotepath}} diff --git a/roles/httpd/reverseproxy/vars/main.yml b/roles/httpd/reverseproxy/vars/main.yml index 61ee936ff3..751fac42b6 100644 --- a/roles/httpd/reverseproxy/vars/main.yml +++ b/roles/httpd/reverseproxy/vars/main.yml @@ -3,3 +3,4 @@ localpath: / destname: reversepassproxy rewrite: false header_scheme: false +keephost: false