You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modproxy-dev@apache.org by "M.Zdila/EpiSoftware Slovakia Ltd." <m....@episoftware.com> on 2003/09/16 12:55:04 UTC

special proxying

Hi

I have a problem I need to solve, but I dont know if it is possible
using mod_proxy:

I'd like to create an elearning web portal which will group and mediate
other elearning resources and portals all over the internet I'll coose.
But all the requests for resources on the other portals have to be
mediated (proxied) by my portal for logging and accounting capabilities.
The problem is, that the "proxy" must in this case rewrite all the URLs
on webpages (I belive).

For example: resource#1 (some webpage) is on OTHERPORTAL server

CLIENT->MYPORTAL: REQUEST for resource#1
MYPORTAL->OTHERPORTAL: REQUEST for resource#1
OTHERPORTAL->MYPORTAL: RESPONSE resource#1
MYPORTAL rewrite all URLs in resource#1 (for example <a href="foo.html">
to <a href="myportal?url=otherportal/foo.html)
MYPORTAL->CLIENT: RESPONSE resource#1

I've already created a proxy program (in PHP) which rewrites all the
URLs in HTML pages ant it works good (forms, cookies, redirects - no
problem). But the problem are Javascript, Java and Flash, because in
theese resources I can't rewrite URLs (I think it is impossible).

Have anybody ANY idea how to solve this problem? Is mod_proxy capable of
this - and if yes - how? Some of my solution is that CLIENT will have to
setup himself proxyserver setting in his browser as my portal (so there
will be no need to rewrite URLs), but I don't want this, it should be
done with no explicit CLIENT's browser configuration.

Please, if you got any idea about this, tell me. Or if I am writing to
wrong mailing list, please tell me some I can write to.

Thanks
Martin



Re: special proxying

Posted by Graham Leggett <mi...@sharp.fm>.
M.Zdila/EpiSoftware Slovakia Ltd. wrote:

> Have anybody ANY idea how to solve this problem? Is mod_proxy capable of
> this - and if yes - how?

If you use the ProxyPass and ProxyPassReverse options to set up a 
reverse proxy, mod_proxy will do what you need to do, yes. Read the 
Apache docs for more details.

On the URL rewriting, it is usually best not to rewrite the URL at all, 
as this breaks many things, like flash, some links, etc like you mentioned.

What you could do is set up a virtual host to front each of the backend 
websites, so http://www.sitea.com/ might be proxied through the virtual 
host http://sitea.myeductionaportal.com/. In this case the URL stays the 
same, only the site name changes. If the site name is hard coded, the 
client's browser will bypass you and go direct to the site and you won't 
see the traffic, but at least it will work.

Another option is to use an URL that redirects them to the remote 
website. The redirector logs the hit, and then the user is passed to the 
remote website directly. You do not have control over this user after 
this, you may or may not want that.

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight..."