[Dancer-users] working with HTTP env vars

P Kishor punk.kish at gmail.com
Fri Aug 20 03:16:30 CEST 2010


On Thu, Aug 19, 2010 at 8:02 PM, Olaf Alders <olaf at wundersolutions.com> wrote:
>
> On 2010-08-19, at 8:52 PM, P Kishor wrote:
>
>>> ok, figured it out. I set log level to debug, and then wrote
>>
>> debug to_dumper(request->env())
>
> What do you get if you comment out ProxyPassReverse in your Apache config and restart Apache?
>


Olaf,

Thanks a ton for holding my hand. I figured out a solution for my
dilemma. First, basically, as far as Apache is concerned, the proxied
request is as if it were made directly. In other words, if I have the
following

    ProxyPass /app/foo http://foo.org

Apache thinks I have actually called http://foo.org directly when I
actually go to http://mywebsite/app/foo. So, none of the URI values
are sent to the forwarded host. Also, as far as I can see, no other
env variables are passed on as well, EXCEPT!

... If I use Proxy, the following setting appears in my env variables:
'HTTP_X_FORWARDED_SERVER'

So, I can detect that value, and set my uri appropriately like so

    url => request->env()->{HTTP_X_FORWARDED_SERVER} ? '/app/foo' : '',


Too bad I can't pass variables from one server to another, but hey,
the above works, so I can move on to the next task.

Many thanks for your help and perseverance.



-- 
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
-----------------------------------------------------------------------
Assertions are politics; backing up assertions with evidence is science
=======================================================================


More information about the Dancer-users mailing list