You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by proteus guy <pr...@gmail.com> on 2007/09/28 20:01:42 UTC

[users@httpd] ProxyPassReverse not working as documented??? (Apache 2.2)

I simply cannot get a reverse proxy operational with mod_proxy on my Fedora
Core 6 setup (Apache 2.2). For example, if I want to proxy flickr.com (just
an example) from as http://mysite.org/flickr I should be able to do the
following according to the docs (
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#examples ):

In my http.conf for mysite.org:
<Location /flickr>
    ProxyPass http://www.flickr.com
    ProxyPassReverse http://www.flickr.com
</Location>

This works initially. Going to http://mysite.org/flickr sure enough gives me
the flickr main page (understand images and stuff are hosted elsewhere so
they're coming direct and not via the proxy but that's ok for our example).
But move your mouse over links like "Sign In" and other relative links and
they show as http://mysite.org/signin instead of the (required)
http://mysite.org/flickr/signin . I understand that links in the page that
start with the protocol will not be re-written but that's not my problem.
ProxyPassReverse is missing that extremely important /flickr Location
identifier for mysite.org to properly proxy this site.

This is driving me nuts and I feel that I'm missing something obvious but I
can't for the life of me get past this. Could some kind soul save me from my
frustration?

  thanx,

    -- Ben

RE: [users@httpd] ProxyPassReverse not working as documented??? (Apache 2.2)

Posted by Axel-Stéphane SMORGRAV <Ax...@europe.adp.com>.
Whenever possible I try to avoid modifying the URL path when reverse proxying. Then mod_proxy_html is not needed and you save some CPU cycles.
 
<Location /flickr>
    ProxyPass http://www.flickr.com/flickr
    ProxyPassReverse http://www.flickr.com/flickr
</Location>

-ascs

________________________________

De : proteus guy [mailto:proteusguy@gmail.com] 
Envoyé : vendredi 28 septembre 2007 21:50
À : users@httpd.apache.org
Objet : Re: [users@httpd] ProxyPassReverse not working as documented??? (Apache 2.2)


Thanx Joshua,

    I do have the mod_proxy_html going now and it works as expected. You're right about "not rewriting URL references inside html" as being pretty categorical - but we tend to see what we want to see and that following sentence implied just what I was looking for so I was perfectly capable of ignoring the prior inconvenient bit. :) 

    -- Ben


On 9/29/07, Joshua Slive <jo...@slive.ca> wrote: 

	Ok. Sorry for my slightly snarky response. But your problem is in the
	interpretation of the term "relative URL". This is referring to URLs
	that don't start with a slash, rather than URLs that don't start with 
	a hostname and scheme. And anyway, the sentence just before this says
	"nor will it rewrite URL references inside HTML pages", which is
	pretty clear and categorical in itself.
	
	--------------------------------------------------------------------- 
	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 <ma...@httpd.apache.org> 
	For additional commands, e-mail: users-help@httpd.apache.org
	
	



---------------------------------------------------------------------
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] ProxyPassReverse not working as documented??? (Apache 2.2)

Posted by proteus guy <pr...@gmail.com>.
Thanx Joshua,

    I do have the mod_proxy_html going now and it works as expected. You're
right about "not rewriting URL references inside html" as being pretty
categorical - but we tend to see what we want to see and that following
sentence implied just what I was looking for so I was perfectly capable of
ignoring the prior inconvenient bit. :)

    -- Ben

On 9/29/07, Joshua Slive <jo...@slive.ca> wrote:
>
> Ok. Sorry for my slightly snarky response. But your problem is in the
> interpretation of the term "relative URL". This is referring to URLs
> that don't start with a slash, rather than URLs that don't start with
> a hostname and scheme. And anyway, the sentence just before this says
> "nor will it rewrite URL references inside HTML pages", which is
> pretty clear and categorical in itself.
>
> ---------------------------------------------------------------------
> 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] ProxyPassReverse not working as documented??? (Apache 2.2)

Posted by Joshua Slive <jo...@slive.ca>.
On 9/28/07, proteus guy <pr...@gmail.com> wrote:
> I did read it (over and over again :) ) but it appears I was thrown off by
> the very next sentence that interprets the sentence you refer to as only
> applying to links in pages that contain absolute URLs which is not, as
> you've clarified, what it means at all. Pardon the confusion... perhaps that
> entry could be made a little more explicit?

Ok. Sorry for my slightly snarky response. But your problem is in the
interpretation of the term "relative URL". This is referring to URLs
that don't start with a slash, rather than URLs that don't start with
a hostname and scheme. And anyway, the sentence just before this says
"nor will it rewrite URL references inside HTML pages", which is
pretty clear and categorical in itself.

---------------------------------------------------------------------
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] ProxyPassReverse not working as documented??? (Apache 2.2)

Posted by proteus guy <pr...@gmail.com>.
I did read it (over and over again :) ) but it appears I was thrown off by
the very next sentence that interprets the sentence you refer to as only
applying to links in pages that contain absolute URLs which is not, as
you've clarified, what it means at all. Pardon the confusion... perhaps that
entry could be made a little more explicit?

     thanx,

     -- Ben

On 9/29/07, Joshua Slive <jo...@slive.ca> wrote:
>
> On 9/28/07, proteus guy <pr...@gmail.com> wrote:
> > I simply cannot get a reverse proxy operational with mod_proxy on my
> Fedora
> > Core 6 setup (Apache 2.2). For example, if I want to proxy flickr.com(just
> > an example) from as http://mysite.org/flickr I should be able to do the
> > following according to the docs (
> > http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#examples
> > ):
> >
> > In my http.conf for mysite.org:
> > <Location /flickr>
> >     ProxyPass http://www.flickr.com
> >     ProxyPassReverse http://www.flickr.com
> > </Location>
> >
> > This works initially. Going to http://mysite.org/flickr sure enough
> gives me
> > the flickr main page (understand images and stuff are hosted elsewhere
> so
> > they're coming direct and not via the proxy but that's ok for our
> example).
> > But move your mouse over links like "Sign In" and other relative links
> and
> > they show as http://mysite.org/signin instead of the (required)
> > http://mysite.org/flickr/signin . I understand that links in the page
> that
> > start with the protocol will not be re-written but that's not my
> problem.
> > ProxyPassReverse is missing that extremely important /flickr Location
> > identifier for mysite.org to properly proxy this site.
> >
> > This is driving me nuts and I feel that I'm missing something obvious
> but I
> > can't for the life of me get past this. Could some kind soul save me
> from my
> > frustration?
>
> It seems to me you have read neither the docs for ProxyPassReverse
> http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypassreverse
> nor the standard tutorial
> http://www.apachetutor.org/admin/reverseproxies
>
> They'll both tell you that you need mod_proxy_html (a third-party
> module) if you want links inside the html pages rewritten.
>
> Joshua.
>
> ---------------------------------------------------------------------
> 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] ProxyPassReverse not working as documented??? (Apache 2.2)

Posted by Joshua Slive <jo...@slive.ca>.
On 9/28/07, proteus guy <pr...@gmail.com> wrote:
> I simply cannot get a reverse proxy operational with mod_proxy on my Fedora
> Core 6 setup (Apache 2.2). For example, if I want to proxy flickr.com (just
> an example) from as http://mysite.org/flickr I should be able to do the
> following according to the docs (
> http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#examples
> ):
>
> In my http.conf for mysite.org:
> <Location /flickr>
>     ProxyPass http://www.flickr.com
>     ProxyPassReverse http://www.flickr.com
> </Location>
>
> This works initially. Going to http://mysite.org/flickr sure enough gives me
> the flickr main page (understand images and stuff are hosted elsewhere so
> they're coming direct and not via the proxy but that's ok for our example).
> But move your mouse over links like "Sign In" and other relative links and
> they show as http://mysite.org/signin instead of the (required)
> http://mysite.org/flickr/signin . I understand that links in the page that
> start with the protocol will not be re-written but that's not my problem.
> ProxyPassReverse is missing that extremely important /flickr Location
> identifier for mysite.org to properly proxy this site.
>
> This is driving me nuts and I feel that I'm missing something obvious but I
> can't for the life of me get past this. Could some kind soul save me from my
> frustration?

It seems to me you have read neither the docs for ProxyPassReverse
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypassreverse
nor the standard tutorial
http://www.apachetutor.org/admin/reverseproxies

They'll both tell you that you need mod_proxy_html (a third-party
module) if you want links inside the html pages rewritten.

Joshua.

---------------------------------------------------------------------
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