Reverse proxy configurations in Webservers

As we know that one of the key feature of using Web Server as reverse proxy is redirections.

I have used OHS 1.x, OHS 11g, and so on configuring them as reverse proxy.

So far I was under the impression that you will require modules such as mod_proxy.so, mod_proxy_connect.so, mod_proxy_http.so, mod_wl_ohs.so, mod_wl_20.so, mod_wl_22.so for performing reverse proxy always. But I was wrong!

Recently when I tested the OHS 10.1.4.3 which is based on Apache 1.3, all I had is libproxy.so in the location of Oracle_Home/Apache/Apache/libexec. Even the mod_proxy.c block is commented out in httpd.conf file. When I just used the ProxyPass and ProxyPassReverse syntax for specific applications, it was working fine.

I also used ReWriteEngine plugin (mod_rewrite.so) for performing the reverse proxy. I found that this is not used for reverse proxy always, anyone to contradict this, please shoot a reply.

If you are proxying the requests using ReWriteEngine  then follow the below syntax.

RewriteEngine On
RewriteRule ^/(.*) http://destination_machine:7777/$1 [P]

This syntax will redirects all URLs to destination server (7777) . So, in my case, I had form login page in ProxyServer machine and Application deployed on destination machine. So, in that case, if I protect the application in OAM and test it, it shows page not found. This is because all requests like Login page is also routed and looked in destination machine.

Even if you are using ProxyPass and ProxyPassReverse for proxy purpose, be cautious to the Context where you want exactly.

For example, when I used the below syntax the flow was getting stopped while showing Login page because the Login page is residing in Proxy Machine.

ProxyPass /                    http://destination_machine:7777/

ProxyPassReverse /     http://destination_machine:7777/

So, when I used the below syntax which will proxy only for destination application, it has started working. I had spent almost 2 hours to troubleshoot this issue ;). So, be cautious while choosing the proxy syntaxes.

ProxyPass /application/                    http://destination_machine:7777/application/
ProxyPassReverse /application/            http://destination_machine:7777/application/

About the Author Mahendra

I am engulfed in Oracle Identity & Access Management domain. I have expertise on providing the optimized solutions for user provisioning, web access management, Single Sign-On and federation capabilities etc., I am also well versed with complex integrations within Identity Management and other product domains. I have expertise on building demos and implementation experience on products Oracle Access Manager, Oracle Adaptive Access Manager, Oracle Entitlement Server, Oracle Virtual Directory, Oracle Internet Directory etc., Look @ my blog: http://talkidentity.blogspot.com

Leave a Comment:

25 comments
Add Your Reply