Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 513
  • Last Modified:

Is it possible to reverse proxy (for Apache), multiple sites, but all have the same path?

I have an SAP environment, where we are doing Reverse proxy for everything.

The reverse proxy is running correctly, except 2 of the subsites from the portal have different server names, but the same path.

How do I reverse proxy for:

http://server1.proxy.net:8023
http://server2.proxy.net:8006

Their unproxied paths are the same for all content: (except the cookie, but the cookie path is the same for both):
/sap/bc/gui/sap/its/mimes

The first statement from the proxied portal (mainproxy.proxy.net) to the subsites (server1,server2) calls the rewrite rule:
for the cookie)
RewriteRule ^/sap(.*)/bc/gui/sap/its/webgui(.*) http://server1.proxy.net:8023$0 [P]
RewriteRule ^/sap(.*)/bc/gui/sap/its/webgui(.*) http://server2.proxy.net:8006$0 [P]

But it never goes to the second.  

Is there a way to examine the headers, or a way to do if/then statements?
Thanks for looking at my question.

Steph
0
blasapher
Asked:
blasapher
1 Solution
 
caterham_wwwCommented:
Yes, you can check http request headers with a RewriteCond.

To check the value of a Cookie sent in the http request by the browser, you might want to use

RewriteCond %{HTTP_COOKIE} something
RewriteRule ^/sap(.*)/bc/gui/sap/its/webgui(.*) http://server2.proxy.net:8006$0 [P]
RewriteRule ^/sap(.*)/bc/gui/sap/its/webgui(.*) http://server1.proxy.net:8023$0 [P]
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now