apache reverse proxy

apache reverse proxy

am 17.05.2004 11:26:19 von Aleksas Spiridenkovas

Hello,
i have problem with reversing "/"
My reverse proxy works fine while i dont use "ProxyPass / http://foo.com/"

This configuration works fine:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule headers_module modules/mod_headers.so
LoadFile /usr/lib/libxml2.so
LoadModule proxy_html_module modules/mod_proxy_html.so



ProxyRequests off
ServerName alpha.foo.com

Order deny,allow
Allow from all


ProxyPass /mirror1/ http://internal1.foo.lan:8080/mirror1/
ProxyPass /mirror2/ http://internal2.foo.lan:8080/mirror2/

ProxyHTMLURLMap http://internal1.foo.lan:8080/mirror1 /mirror1
ProxyHTMLURLMap http://internal2.foo.lan:8080/mirror2 /mirror2


ProxyPassReverse /
SetOutputFilter proxy-html
ProxyHTMLURLMap / /mirror1/
ProxyHTMLURLMap /mirror1 /mirror2
RequestHeader unset Accept-Encoding



ProxyPassReverse /
SetOutputFilter proxy-html
ProxyHTMLURLMap / /mirror2/
ProxyHTMLURLMap /mirror1 /mirror1
RequestHeader unset Accept-Encoding




But then i add to this configuration something like:

ProxyPass / http://foo.foo.lan/
ProxyPassReverse / http://foo.foo.lan/

mirror1 and mirror2 cannot be found without adding trailing slash,
Becouse everything goes thrue "/". (Everything is searched in foo.foo.lan
server and everything fails becouse there is no mirror1 and mirror2 in
foo.foo.lan).

How can be this problem solved?




Alex

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

RE: Apache Reverse proxy

am 12.08.2005 15:11:21 von Rajiv.Ranjan

Hi Benoit,

Alex on this group suggested me to go with ProxyPass instead of
using rewrite rule. I tried that and it worked for me.

Here is the text Alex had send me - (Maybe it would help you as well)


ServerName www.in.abc.org
ProxyVia off
Redirect / http://www.in.abc.org/wps/portal


ProxyPass http://www.dev01.abc.org:9081/wps
ProxyPassReverse http://www.dev01.abc.org:9081/wps=20



Works for me, should work for you too. www.dev01.abc.org could be an
alias for www.in.abc.org or vice-versa since from what I understand,
they both share the same IP address.

As pointed out previously, your problem lies in the domain of the
cookies served by WAS. My guess is that those cookies are in the
dev01.abc.org domain, whereas the browsers access the application in the
in.abc.org domain in which the cookies would not apply.

As all the users are located only in the in.abc.org domain, you can
change the domain name of WAS through the WAS Administrative Console
Security->Authentication Mechanisms->LTPA. Set the value of the "Domain
Name" field to "in.abc.org". This would set the domain of the JSESSIONID
cookie to a value which would allow the client browsers to include the
cookie in the requests.

If you don't, the browser will not include the cookies in the requests.

Another way of doing this would be to use the
ProxyPassReverseCookieDomain directive:

ProxyPassReverseCookieDomain .dev01.abc.org .in.abc.org

Unfortunately this directive has not been implemented in any release of
Apache 2.0. You would need to apply patch 11915 (see Bugzilla bug report
10722).

In order to debug such problems, if you use MSIE I would strongly urge
you to use a tool like HTTPWatch (http://www.httpwatch.com/default.htm)
which will allow you to see the headers and cookies in requests as well
as in responses, whether a page was served from cache, etc. It gives you
a very nice insight into all requests and responses. I you use Mozilla,
I understand there is a similar feature called something like "Live HTTP
Headers".

Another way of investigating such problems might be using a network
sniffer like Ethereal, or a proxy like Burp. That's would be my second
choice though, because a browser plug-in is a lot more user-friendly.

For a little cookie tutorial, look at
http://www.httpwatch.com/httpgallery/cookies/.


_Rajiv


-----Original Message-----
From: benoit.herard@equant.com [mailto:benoit.herard@equant.com]=20
Sent: Friday, August 12, 2005 6:34 PM
To: Ranjan, Rajiv
Subject: Apache Reverse proxy

Hi Rajiv,


I'm searching over the web about my own problem with using apache as a
reverse proxy and obviouly you've got the same problem as me.
"How to use apache as cookie gateway ?"
(The docs I found about my problem was always your case)

After running google a lot and testing a lot, I think that apache 2.0 is
not able to do so. The mod_rewrite can only work on URL and not on the
content of the HTTP flow.

Did you finally succed to solve the problem without using Apache 2.1
alpha
version ?
If Yes, what's the solution ?




Best regards Benoit
------------------------------------------------------------ ------------
-----------------------------------------------------


Benoit HERARD
EQ/PIT/SIS/OSS/CPM
rue Latouche Lambert
35510 CESSON-SEVIGNE
FRANCE

Tel : +33 (0)2 23 28 35 20






-------------------Warning------------------------

This e-mail is from outside Tesco - check that it is genuine. Tesco may
monitor and record all e-mails.




---- Disclaimer ----
This is a confidential email. Tesco may monitor and record all emails. Th=
e views expressed in this email are those of the sender and not Tesco. =20
Tesco Stores Limited, Tesco House, Delamare Road, Cheshunt, Herts, EN8 9SL:=
company number 519500.=20


------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org