From c2e03dec03a56ab77042ee03a993015986fe129a Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Mon, 16 Sep 2019 09:46:33 +0200 Subject: [PATCH] fix: [apache] proxy rewrites response header only if needed Previously, we had issues (for instance with nextcloud) with the 'Location' header using the custom scheme "nc://" being rewritten by "ProxyPassReverse /". This newer stance avoids rewriting this scheme, and continue to work correctly. --- apache/lib/common | 2 +- apache/test/vhost | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apache/lib/common b/apache/lib/common index 617b50b..7a70f2e 100644 --- a/apache/lib/common +++ b/apache/lib/common @@ -703,7 +703,7 @@ __vhost_proxy_statement() { ProxyPass / http://$target/ ${proxy_pass_options[*]} $(__vhost_creds_statement "$cfg" "$dest" | prefix " ") - ProxyPassReverse / + ProxyPassReverse http://$target/ $([ "$protocol" == "https" ] && echo " SSLProxyEngine On") diff --git a/apache/test/vhost b/apache/test/vhost index ebcd4f7..497ca19 100644 --- a/apache/test/vhost +++ b/apache/test/vhost @@ -168,7 +168,7 @@ is out part ' AuthName "private" AuthUserFile /etc/apache2/sites-enabled/www.example.com.passwd Require valid-user - ProxyPassReverse / + ProxyPassReverse http://popo:3333/ ' @@ -290,7 +290,7 @@ is out ' ProxyPass / http://popo:3333/ retry=0 Allow from all - ProxyPassReverse / + ProxyPassReverse http://popo:3333/ @@ -343,7 +343,7 @@ is out ' ProxyPass / http://popo:3333/ retry=0 Allow from all - ProxyPassReverse / + ProxyPassReverse http://popo:3333/ SSLProxyEngine On