Issue
I'm new on apache reverse proxy, and I trying to reverse Url calling like bellow:
I'm able to forward all request on Webserver1 like that:
<VirtualHost *:80>
ProxyPreserveHost On
ServerName localhost
ProxyPass / http://webserver1/
ProxyPassReverse / http://webserver1/
</VirtualHost>
But I'm not able to make condition on Url Param example:
If "http://reverse.proxy.com/?param=foo" then forwarding it to WebServer 2
And also, I don't know if those rules could be on the Same configuration.
Many thanks for your help
Solution
Finally, I found the solution to do like that.
<VirtualHost *:80>
ProxyPreserveHost On
ServerName localhost
RewriteEngine on
logLevel warn rewrite:trace3
RewriteCond %{REQUEST_URI} ^/ [NC]
RewriteCond %{QUERY_STRING} ^param=(.*)
RewriteRule (.*) http://Webserver2/?param=%1? [P]
ProxyPassMatch / http://Webserver1
ProxyPassReverse / http://Webserver1
</VirtualHost>
it seems working fine
Answered By - Loudone Answer Checked By - Marie Seifert (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.