RewriteCond %{REMOTE_ADDR} ^10\.2\.One possible scenario for this if you want to migrate your users from server A to server B but you want to migrate one IP range at the time.
RewriteRule ^/(.*) http://old-app/$1 [P]
ProxyPassReverse / http://serverA/
RewriteCond %{REMOTE_ADDR} ^10\.3\.
RewriteRule ^/(.*) http://new-app/$1 [P]
ProxyPassReverse / http://serverB/
If you're using Apache 2.4 or newer you can also achieve this with the following configuration:
<If "-R '10.2.0.0/16'">
ProxyPassReverse / /http://serverA/
</If>
<ElseIf "-R '10.3.0.0/16'">
ProxyPassReverse / /http://serverB/
</ElseIf>
<Else>
ProxyPassReverse / /http://serverC/
</Else>
Your Apache 2.4 solution is invalid because there cannot be a ProxyPassReverse statement in the section.
ReplyDelete