Closed brablc closed 9 years ago
Interesting, can you please provide some traffic dumps so I can reproduce the issue here.
The setup:
mkdir -p /var/www/domain1 && echo "WRONG" >$_/test.html
mkdir -p /var/www/domain2 && echo "OK" >$_/test.html
<VirtualHost *:80>
ServerName domain1.dev
RewriteEngine On
RewriteLogLevel 9
RewriteLog /var/log/apache2/rewrite.log
RewriteRule /domain2/(.*) http://domain2.dev/$1 [P]
DocumentRoot /var/www/domain1
</VirtualHost>
<VirtualHost *:80>
ServerName domain2.dev
DocumentRoot /var/www/domain2
</VirtualHost>
Test curl http://domain1.dev/domain2/test.html
RPAFsethostname off
:127.0.0.1 - - [14/Oct/2015:22:45:53 +0200] [domain1.dev/sid#7fdc2cf82c78][rid#7fdc2d953040/initial] (2) init rewrite engine with requested uri /domain2/test.html
127.0.0.1 - - [14/Oct/2015:22:45:53 +0200] [domain1.dev/sid#7fdc2cf82c78][rid#7fdc2d953040/initial] (3) applying pattern '/domain2/(.*)' to uri '/domain2/test.html'
127.0.0.1 - - [14/Oct/2015:22:45:53 +0200] [domain1.dev/sid#7fdc2cf82c78][rid#7fdc2d953040/initial] (2) rewrite '/domain2/test.html' -> 'http://domain2.dev/test.html'
127.0.0.1 - - [14/Oct/2015:22:45:53 +0200] [domain1.dev/sid#7fdc2cf82c78][rid#7fdc2d953040/initial] (2) forcing proxy-throughput with http://domain2.dev/test.html
127.0.0.1 - - [14/Oct/2015:22:45:53 +0200] [domain1.dev/sid#7fdc2cf82c78][rid#7fdc2d953040/initial] (1) go-ahead with proxy request proxy:http://domain2.dev/test.html [OK]
RPAFsethostname on
:127.0.0.1 - - [14/Oct/2015:22:46:32 +0200] [domain1.dev/sid#7fc5de794c78][rid#7fc5df15f010/initial] (2) init rewrite engine with requested uri /domain2/test.html
127.0.0.1 - - [14/Oct/2015:22:46:32 +0200] [domain1.dev/sid#7fc5de794c78][rid#7fc5df15f010/initial] (3) applying pattern '/domain2/(.*)' to uri '/domain2/test.html'
127.0.0.1 - - [14/Oct/2015:22:46:32 +0200] [domain1.dev/sid#7fc5de794c78][rid#7fc5df15f010/initial] (2) rewrite '/domain2/test.html' -> 'http://domain2.dev/test.html'
127.0.0.1 - - [14/Oct/2015:22:46:32 +0200] [domain1.dev/sid#7fc5de794c78][rid#7fc5df15f010/initial] (2) forcing proxy-throughput with http://domain2.dev/test.html
127.0.0.1 - - [14/Oct/2015:22:46:32 +0200] [domain1.dev/sid#7fc5de794c78][rid#7fc5df15f010/initial] (1) go-ahead with proxy request proxy:http://domain2.dev/test.html [OK]
127.0.0.1 - - [14/Oct/2015:22:46:32 +0200] [domain1.dev/sid#7fc5de794c78][rid#7fc5df15f010/initial] (2) init rewrite engine with requested uri /test.html
127.0.0.1 - - [14/Oct/2015:22:46:32 +0200] [domain1.dev/sid#7fc5de794c78][rid#7fc5df15f010/initial] (3) applying pattern '/domain2/(.*)' to uri '/test.html'
127.0.0.1 - - [14/Oct/2015:22:46:32 +0200] [domain1.dev/sid#7fc5de794c78][rid#7fc5df15f010/initial] (1) pass through /test.html
Please provide the rpaf comfig also
<IfModule mod_rpaf.c>
RPAFenable On
RPAFsethostname Off
RPAFproxy_ips 127.0.0.1 10.0.2.15
</IfModule>
This config is invalid for the current version of mod_rpaf, please confirm you are running a recent version.
OK, let's close this until I migrate to newer version. I do not have testing environment for this right now.
When requesting http://domain1.dev/domain2/test.html with the following configuration:
One would expect to get content of http://domain2.dev/test.html, but this would not work when rpaf is enabled and
RPAF_SetHostName
set toOn
. You would get http://domain1.dev/test.html - it seems like RPAF replaces theHost
header fromdomain2.dev
todomain1.dev
in the proxied request.Both
domain1.dev
anddomain2.dev
resolve to the same IP address.