You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Abhi <ab...@gmail.com> on 2008/11/04 14:39:42 UTC

[users@httpd] reverse proxy question

The scenario is:

I want to forward the request of this format

http://localhost/foo/moo.flv

to

http://bar.com/cgi-bin/outflv.pl?flv=moo.flv

If I have the following rule in my apache2.conf file it does not work.

ProxyPass /foo/  http://bar.com/cgi-bin/outflv.pl?flv=

Is there a way to achieve this?
-- 
Cheers,
Abhi

Re: [users@httpd] reverse proxy question

Posted by Abhi <ab...@gmail.com>.
I apologise.

Thanks Krist and Tom. It is working like a charm now.

Can someone please tell me or point me to some literature as to why the
proxy pass did not work with the rule I specified?

On Tue, Nov 4, 2008 at 10:34 PM, Tom Evans <te...@googlemail.com> wrote:

> On Tue, 2008-11-04 at 22:03 +0530, Abhi wrote:
> > Thanks for that Krist.
> >
> > I want to do it without a redirect. I am trying to do something with
> > google gears and google gears has the same origin security policy. So
> > I cannot cache URL's with different domains.
> >
> > Is there any way I can achieve this with an internal forward rather
> > than a redirect?
> >
>
> Re-read his rule, the [P] flag to RewriteRule turns it from redirecting
> the user to the rewritten URL, to proxying it internally to the
> rewritten URL.
>
> Cheers
>
> Tom
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> 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
>
>


-- 
Cheers,
Abhi

Re: [users@httpd] reverse proxy question

Posted by Tom Evans <te...@googlemail.com>.
On Tue, 2008-11-04 at 22:03 +0530, Abhi wrote:
> Thanks for that Krist.
> 
> I want to do it without a redirect. I am trying to do something with
> google gears and google gears has the same origin security policy. So
> I cannot cache URL's with different domains. 
> 
> Is there any way I can achieve this with an internal forward rather
> than a redirect? 
> 

Re-read his rule, the [P] flag to RewriteRule turns it from redirecting
the user to the rewritten URL, to proxying it internally to the
rewritten URL.

Cheers

Tom


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] reverse proxy question

Posted by Abhi <ab...@gmail.com>.
Thanks for that Krist.

I want to do it without a redirect. I am trying to do something with google
gears and google gears has the same origin security policy. So I cannot
cache URL's with different domains.

Is there any way I can achieve this with an internal forward rather than a
redirect?

On Tue, Nov 4, 2008 at 7:38 PM, Krist van Besien
<kr...@gmail.com>wrote:

>
>
> On Tue, Nov 4, 2008 at 2:39 PM, Abhi <ab...@gmail.com> wrote:
>
>> The scenario is:
>>
>> I want to forward the request of this format
>>
>> http://localhost/foo/moo.flv
>>
>> to
>>
>> http://bar.com/cgi-bin/outflv.pl?flv=moo.flv
>>
>> If I have the following rule in my apache2.conf file it does not work.
>>
>> ProxyPass /foo/  http://bar.com/cgi-bin/outflv.pl?flv=
>>
>> Is there a way to achieve this
>
>
> Yes.
>
> RewriteRule /foo/(.*)   http://bar.com/cgi-bin/outflv.pl?flv=$1 [P]<http://bar.com/cgi-bin/outflv.pl?flv=>
>
> Krist
>
>
> --
> krist.vanbesien@gmail.com
> krist@vanbesien.org
> Bremgarten b. Bern, Switzerland
> --
> A: It reverses the normal flow of conversation.
> Q: What's wrong with top-posting?
> A: Top-posting.
> Q: What's the biggest scourge on plain text email discussions?
>



-- 
Cheers,
Abhi

Re: [users@httpd] reverse proxy question

Posted by Krist van Besien <kr...@gmail.com>.
On Tue, Nov 4, 2008 at 2:39 PM, Abhi <ab...@gmail.com> wrote:

> The scenario is:
>
> I want to forward the request of this format
>
> http://localhost/foo/moo.flv
>
> to
>
> http://bar.com/cgi-bin/outflv.pl?flv=moo.flv
>
> If I have the following rule in my apache2.conf file it does not work.
>
> ProxyPass /foo/  http://bar.com/cgi-bin/outflv.pl?flv=
>
> Is there a way to achieve this


Yes.

RewriteRule /foo/(.*)   http://bar.com/cgi-bin/outflv.pl?flv=$1
[P]<http://bar.com/cgi-bin/outflv.pl?flv=>

Krist


-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?