You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by vi...@yahoo.co.in on 2012/10/17 06:26:03 UTC

[users@httpd] ProxyPassReverse

All,

I have very basic query, pls help me in understand that.. What is the purpose of using ProxyPassReverse in apache config..what i understand is that it rewrite the headers but that means what??

Can someone give any use case/real time example which will help me in understanding the crux of this directive.

Thanks for ur help in advance,
Vicky
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] ProxyPassReverse

Posted by Daniel Ruggeri <DR...@primary.net>.
On 10/17/2012 7:32 AM, Eric Covener wrote:
> Sometimes headers have a URL in them. If your backend puts its own URL
> in a header, Apache can replace it with the frontend URL.

Exactly - ProxyPassReverse fixes Location headers sent by a backend
during a redirect. It replaces the part matched with the value of your
server name (note UseCanonicalName comes into play in this case).

For a bit more elaboration, consider this configuration snippet:
   ProxyPass /context  http://backend.com/context
   #ProxyPassReverse /context http://backend.com/context

Request:
   GET /context HTTP/1.1
   host: frontend.com
   connection:close

Response:
   HTTP/1.1 302 Found
   Location: http://backend.com/context/

With ProxyPassReverse line enabled (uncommented), this will instead happen:
Request:
   GET /context HTTP/1.1
   host: frontend.com
   connection:close

Response:
   HTTP/1.1 302 Found
   Location: http://frontend.com/context/

It will replace all occurrences of the second argument with a
self-constructed URL of the server. The first argument is used to
translate the path if needed.

--
Daniel Ruggeri



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] ProxyPassReverse

Posted by Eric Covener <co...@gmail.com>.
On Wed, Oct 17, 2012 at 8:21 AM,  <vi...@yahoo.co.in> wrote:
> Is it possible for you to elaborate on this .. I m too naive for this.. Excuse this if i sounds silly
>
> Thanks,
> Vicky

Sometimes headers have a URL in them. If your backend puts its own URL
in a header, Apache can replace it with the frontend URL.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] ProxyPassReverse

Posted by vi...@yahoo.co.in.
Is it possible for you to elaborate on this .. I m too naive for this.. Excuse this if i sounds silly

Thanks,
Vicky



On Oct 17, 2012, at 4:32 PM, Eric Covener <co...@gmail.com> wrote:

> On Wed, Oct 17, 2012 at 12:26 AM,  <vi...@yahoo.co.in> wrote:
>> All,
>> 
>> I have very basic query, pls help me in understand that.. What is the purpose of using ProxyPassReverse in apache config..what i understand is that it rewrite the headers but that means what??
>> 
>> Can someone give any use case/real time example which will help me in understanding the crux of this directive.
> 
> http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypassreverse
> 
> """
> This directive lets Apache adjust the URL in the Location,
> Content-Location and URI headers on HTTP redirect responses. This is
> essential when Apache is used as a reverse proxy (or gateway) to avoid
> by-passing the reverse proxy because of HTTP redirects on the backend
> servers which stay behind the reverse proxy.
> """
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] ProxyPassReverse

Posted by Eric Covener <co...@gmail.com>.
On Wed, Oct 17, 2012 at 12:26 AM,  <vi...@yahoo.co.in> wrote:
> All,
>
> I have very basic query, pls help me in understand that.. What is the purpose of using ProxyPassReverse in apache config..what i understand is that it rewrite the headers but that means what??
>
> Can someone give any use case/real time example which will help me in understanding the crux of this directive.

http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypassreverse

"""
This directive lets Apache adjust the URL in the Location,
Content-Location and URI headers on HTTP redirect responses. This is
essential when Apache is used as a reverse proxy (or gateway) to avoid
by-passing the reverse proxy because of HTTP redirects on the backend
servers which stay behind the reverse proxy.
"""

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org