views:

5

answers:

0

I am using Apache2 with mod_perl and Plack::Handler::Apache2. My web site is at http://mywebsite.org/. In the VirtualHost definition of mywebsite.org, I have the following

ProxyPass /app/one http://one.org/
ProxyPassReverse /app/one http://one.org/

ProxyPass /app/two http://two.org/
ProxyPassReverse /app/two http://two.org/

Of course, http://one.org and http://two.org are separate web sites that appear to be a part of http://mywebsite.org/ at http://mywebsite.org/app/one and http://mywebsite.org/app/two.

Now, the problem is, when the user goes to http://mywebsite.org/app/one, the actual application at http://one.org gets the request_uri as '/' instead of '/app/one'. What I want is to get within the app the actual URI in the browser address bar. This would enable me to determine whether my 'one app' was being called via http://mywebsite.org/app/one or via http://one.org.

One way would be to pass an Apache env var via the proxy request. I tried the following

<Proxy *>
    Order deny,allow
    Allow from all
    SetEnv APP_PATH /app
</Proxy>

hoping to grab %ENV{APP_PATH} inside my 'one app' (and 'two app'), and use that to set my application paths, however, it seems APP_PATH doesn't come through to the final application.

Suggestions?

related questions