Browse Source

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.
framadate
Valentin Lab 5 years ago
parent
commit
c2e03dec03
  1. 2
      apache/lib/common
  2. 6
      apache/test/vhost

2
apache/lib/common

@ -703,7 +703,7 @@ __vhost_proxy_statement() {
ProxyPass / http://$target/ ${proxy_pass_options[*]}
<Location / >
$(__vhost_creds_statement "$cfg" "$dest" | prefix " ")
ProxyPassReverse /
ProxyPassReverse http://$target/
</Location>
$([ "$protocol" == "https" ] && echo " SSLProxyEngine On")
</IfModule>

6
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/
</Location>
'
@ -290,7 +290,7 @@ is out '<VirtualHost *:80>
ProxyPass / http://popo:3333/ retry=0
<Location / >
Allow from all
ProxyPassReverse /
ProxyPassReverse http://popo:3333/
</Location>
</IfModule>
@ -343,7 +343,7 @@ is out '<VirtualHost *:80>
ProxyPass / http://popo:3333/ retry=0
<Location / >
Allow from all
ProxyPassReverse /
ProxyPassReverse http://popo:3333/
</Location>
SSLProxyEngine On
</IfModule>

Loading…
Cancel
Save