Forum Moderators: phranque
I have some basic knowledge about apache configuration. Now I have to configure apache server as a reverse proxy to route the request to WebSEAL. This is the task that I have to accomplish. Whenever the request ed URL contains “demojunction” route the request to backend server without any modification but if the request URL doesn’t have the “demojunction”, then append the “demojunction” and send it to the backend. We may have to use some sort of regular expression to match the value. I don’t know how to configure this. If anyone has knowledge of this, please help me.
Scenario 1
Input URL : http://example.com/demojunction/appName/foo.html
No modification is required and sends it directly to the backend server
Scenario 2
Input URL : http://example.com/appName/foo.html
Since “demojunction” is missing in the URL, I have to append it and send it to the backend.
Please help
Thanks
[edited by: jdMorgan at 9:56 pm (utc) on Oct. 9, 2007]
[edit reason] example.com [/edit]
Thanks for the response. I was trying to use the "ProxyPass" and "ProxyPassreverse" to direct the call to the backend server. Here the scenario is user request something to the backend server. For instance, user might have requested for http://example.com/demojunction/appName/foo.html. In this case “demojunction” is already a part of the URL so we don’t have to do anything. If the URL requested doesn’t have “demojunction” , then append that to the URL and send it to the backend server. So I am assume, we may have to do some regular expression searching for the existence of the “demojunction” in the URL. Based on the outcome of regular expression, we have to decide on either appending it or not. I don’t know how to put the regular expression and send the request to the backend server using ProxyPass. Could you please the snippet of code to do this.
Please help.
Httpd.conf
<VirtualHost *>
ProxyPass / demojunction [sub.example.com...]
ProxyPassreverse / [sub.example.com...]
</VirtualHost>
[edited by: jatar_k at 3:56 pm (utc) on Oct. 10, 2007]
[edit reason] please use example.com [/edit]
Having implemented a rewrite, you have two choices: Either terminate mod_rewrite processing immediately and let mod_proxy take over (using the [PT] and [L] flags on the RewriteRule [httpd.apache.org], or use mod_rewrite to invoke the reverse proxy request directly using the [P] flag on the RewriteRule. Which of these methods you choose is largely a matter of 'style.'
For info on how to get the most out of this forum, please see our forum charter [webmasterworld.com].
Thanks,
Jim