Not a Dev question .. but can someone help me
Not a Dev question .. but can someone help me
am 13.08.2002 18:50:50 von PLancashire
I have a need for a proxy server to hide an internal
host, and I jumped in and said Apache could be used vs.
the desire to buy and use Microsoft Proxy Server.
If there is someone that could help save Apache, I would
be most grateful, this would be a great win for OSS where
I work.
I've submitted my problem to the general Apache help list but
have not heard back.
The problem is reverse URL's are not get converted to that of
the "public" machine, the one being accessed by the users.
Anyway, would the list mind if I post what I have so far ?
Thanks,
-pete
RE: Not a Dev question .. but can someone help me
am 13.08.2002 19:10:32 von PLancashire
Well here I go ..=20
here I'm having a problem is in doing a reverse URL conversion,
forward is just fine.
What I'm trying to do is have a Apache 1.3.24 (eventually 2.x) server
act only as a proxy. Getting forward to work has been easy, but getting
the reverse to be hidden is not being much fun.
I have a host that is accessible to the internet (actually behind a
firewall and has IP restrictions) called outside, this is the one
with Apache and a host inside or hidden called inside.
(Real names changed to protect the guilty)
http://outside/images -> http://inside/
and
http://outside/images/ -> http://inside/
Work just fine, and thanks to another list on how to get this to
work without a trialing slash.
but no matter what I do I can not get the correct reverse translation to
work
http://inside/you-name-it to become http://outside/images/you-name-it
What I have so far in my httpd.conf is:
------------------------------------------------------------ -
RewriteRule ^/images/*(.+) http://inside/$1 [P]
ProxyPass /images/
ProxyPassReverse /images/
ProxyPassReverse /images/
------------------------------------------------------------ --
The "home" URL that one would get if they where accessing the inside
server
directly is:=20
http://inside.hidden.xyz/servlet/foo.bar.servlet.login.Login Servlet?acti
on=3D1
This is the URL that http://outside/images is trying to proxy.
Hope all this makes sense
-pete
Re: Not a Dev question .. but can someone help me
am 13.08.2002 19:41:58 von Maurizio Marini
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tuesday 13 August 2002 07:10 pm, Lancashire, Pete wrote:
>What I have so far in my httpd.conf is:
>----------------------------------------------------------- --
>RewriteRule ^/images/*(.+) http://inside/$1 [P]
>
>ProxyPass /images/
>
>ProxyPassReverse /images/
>ProxyPassReverse /images/
>----------------------------------------------------------- ---
u are doing 2 times the same thing, w/ RewriteRuke and ProxyPass
ProxyPassReverse is duplicated, too, u have 2 Reverse for /images/
- -- maumar
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE9WUTm4Q/49nIJTlwRAg0PAJ9WtnxjXZvRzT7lBNGd9SyKO4V4ZACe NYEu
j2fALzaUNr2U5NgNRoGAoaU=3D
=3DzsYa
-----END PGP SIGNATURE-----
Re: Not a Dev question .. but can someone help me
am 14.08.2002 09:03:28 von Graham Leggett
Lancashire, Pete wrote:
> What I'm trying to do is have a Apache 1.3.24 (eventually 2.x) server
> act only as a proxy.
Use v1.3.26 - the proxy you are using has bugs which have been fixed.
> http://outside/images -> http://inside/
> and
> http://outside/images/ -> http://inside/
>
> Work just fine, and thanks to another list on how to get this to
> work without a trialing slash.
>
> but no matter what I do I can not get the correct reverse translation to
> work
>
> http://inside/you-name-it to become http://outside/images/you-name-it
Remember that the ProxyPassReverse translation mechanism doesn't try and
be clever - it simply does an exact prefix match replacement. Also
remember that the translation *only* happens for stuff in the response
headers, like redirects. It *does not* translate stuff in the HTML
itself, because a) it's too expensive and b) it will probably get it
wrong anyway.
As a general rule it is best to make sure that the URI you use on the
frontend is the same as the URI used on the backend. ie, if it's
http://outside/images/you-name-it on the outside, then it should be
http://inside/images/you-name-it on the inside.
The reason for this is that if a web designer embeds an URL in a page
called /images/blah.gif, it will work on the backend but won't work on
the frontend. Usually it's a lot easier to keep the URL spaces the same,
rather than trying to change your website to relative links afterwards.
> What I have so far in my httpd.conf is:
> ------------------------------------------------------------ -
> RewriteRule ^/images/*(.+) http://inside/$1 [P]
>
> ProxyPass /images/
>
> ProxyPassReverse /images/
> ProxyPassReverse /images/
> ------------------------------------------------------------ --
All you need is:
ProxyPass
/images/ http://inside/
ProxyPassReverse
/images/
http://inside/
A few points to note:
- Remember that ProxyPassReverse does an exact copy-replace. If the user
tries the URL "http://outside/images" it *won't* match because
"/images/" is not a substring of "/images".
- Makes sure that "inside" is the correct name for the website. If
ProxyPassReverse says look for "http://inside/" but the inside website
identifies itself as "http://inside.blah.zxy/" or "http://ip.add.re.ss/,
it definitely won't work. Garbage in, garbage out.
- You aren't keeping the URL spaces the same. ie, you should rather try
this instead:
ProxyPass
/images/ http://inside/images/
ProxyPass
/servlet/ http://inside/servlet/
Regards,
Graham
--
-----------------------------------------
minfrin@sharp.fm
"There's a moon
over Bourbon Street
tonight..."