You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Mohammad Kargar - Indicee <Mo...@indicee.com> on 2008/07/21 04:19:07 UTC

[users@httpd] ProxyPass redirects the request

I'm using the following configuration to setup my local Apache as a
reverse proxy for the app server (let's call it
http://www.backend.com/). The problem is that apache server redirects
all the requests to /mytest/ to the backend (http://www.backend.com/)
instead of transparently providing the content from it. 

 

Does anybody know what I'm missing here?

 

 

ProxyRequests Off

 

<Proxy *>

Order deny,allow

Allow from all

</Proxy>

 

ProxyPass /mytest/ http://www.backend.com/

ProxyPassReverse /mytest/ http://www.backend.com/

 

 

 

-Thanks,

 

Mohammad


RE: [users@httpd] ProxyPass redirects the request

Posted by Mohammad Kargar - Indicee <Mo...@indicee.com>.
Followed the instructions from
http://www.apachetutor.org/admin/reverseproxies and finally ended up
with the new configuration below (this snippet added to the end of the
original httpd.conf). However still it doesn't work. Is there any way to
debug this code to see what the problem is?

LoadFile    /usr/lib/libxml2.so.2
LoadModule  proxy_html_module    modules/mod_proxy_html.so

ProxyRequests Off

ProxyPass /test/ http://192.168.231.1/
ProxyHTMLURLMap http://192.168.231.1 /test

<Location /test/>
        ProxyPassReverse /
        SetOutputFilter  proxy-html
        ProxyHTMLURLMap  /      /test/
        ProxyHTMLURLMap  /test  /test
        RequestHeader    unset  Accept-Encoding
</Location>


Thanks,

Mohammad

-----Original Message-----
From: Mohammad Kargar - Indicee 
Sent: Monday, July 21, 2008 8:42 AM
To: 'users@httpd.apache.org'
Subject: RE: [users@httpd] ProxyPass redirects the request


Thank you very much. It seems that
http://www.apachetutor.org/admin/reverseproxies is the one I need to
follow to solve the issue. While I'm doing so, I'd like to ask one more
question:

My original requirement is to implement a maintenance page. In other
words, all I need to do is to display a simple page with a simple
message saying that system is down for maintenance when we have to bring
down the back-end server. Not sure if setting up a reverse proxy for
this purpose is a good idea. Is there any other way to achieve the same
goal?

Thanks,

Mohammad

-----Original Message-----
From: Nick Kew [mailto:nick@webthing.com] 
Sent: Monday, July 21, 2008 6:47 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] ProxyPass redirects the request

On Sun, 20 Jul 2008 19:19:07 -0700
"Mohammad Kargar - Indicee" <Mo...@indicee.com> wrote:

> Does anybody know what I'm missing here?

http://www.apachetutor.org/admin/reverseproxies

> ProxyPass /mytest/ http://www.backend.com/
> 
> ProxyPassReverse /mytest/ http://www.backend.com/

That's only part of the story.  If (as Joshua suggests)
you've got a javascript redirect, it can be seriously
challenging: you'll need mod_proxy_html's ProxyHTMLExtended
(for script embedded in HTML), or one of the sed-like
filters (mod_sed, mod_substitute, mod_line_edit) if
it's in a separate .js file.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.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


---------------------------------------------------------------------
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] ProxyPass redirects the request

Posted by Nick Kew <ni...@webthing.com>.
On Mon, 21 Jul 2008 08:41:59 -0700
"Mohammad Kargar - Indicee" <Mo...@indicee.com> wrote:

> 
> Thank you very much. It seems that
> http://www.apachetutor.org/admin/reverseproxies is the one I need to
> follow to solve the issue. While I'm doing so, I'd like to ask one
> more question:
> 
> My original requirement is to implement a maintenance page.

An ErrorDocument is often a good solution to that.


-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.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] ProxyPass redirects the request

Posted by Mohammad Kargar - Indicee <Mo...@indicee.com>.
Thank you very much. It seems that
http://www.apachetutor.org/admin/reverseproxies is the one I need to
follow to solve the issue. While I'm doing so, I'd like to ask one more
question:

My original requirement is to implement a maintenance page. In other
words, all I need to do is to display a simple page with a simple
message saying that system is down for maintenance when we have to bring
down the back-end server. Not sure if setting up a reverse proxy for
this purpose is a good idea. Is there any other way to achieve the same
goal?

Thanks,

Mohammad

-----Original Message-----
From: Nick Kew [mailto:nick@webthing.com] 
Sent: Monday, July 21, 2008 6:47 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] ProxyPass redirects the request

On Sun, 20 Jul 2008 19:19:07 -0700
"Mohammad Kargar - Indicee" <Mo...@indicee.com> wrote:

> Does anybody know what I'm missing here?

http://www.apachetutor.org/admin/reverseproxies

> ProxyPass /mytest/ http://www.backend.com/
> 
> ProxyPassReverse /mytest/ http://www.backend.com/

That's only part of the story.  If (as Joshua suggests)
you've got a javascript redirect, it can be seriously
challenging: you'll need mod_proxy_html's ProxyHTMLExtended
(for script embedded in HTML), or one of the sed-like
filters (mod_sed, mod_substitute, mod_line_edit) if
it's in a separate .js file.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.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


---------------------------------------------------------------------
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] ProxyPass redirects the request

Posted by Nick Kew <ni...@webthing.com>.
On Sun, 20 Jul 2008 19:19:07 -0700
"Mohammad Kargar - Indicee" <Mo...@indicee.com> wrote:

> Does anybody know what I'm missing here?

http://www.apachetutor.org/admin/reverseproxies

> ProxyPass /mytest/ http://www.backend.com/
> 
> ProxyPassReverse /mytest/ http://www.backend.com/

That's only part of the story.  If (as Joshua suggests)
you've got a javascript redirect, it can be seriously
challenging: you'll need mod_proxy_html's ProxyHTMLExtended
(for script embedded in HTML), or one of the sed-like
filters (mod_sed, mod_substitute, mod_line_edit) if
it's in a separate .js file.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.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] ProxyPass redirects the request

Posted by Phil Lefort <Ph...@tumbleweed.com>.
You might want to try:

 

ProxyPass // http://www.backend.com/

ProxyPassReverse // http://www.backend.com/

 

References to mytest on the front-end will end up rendering

the mytest info in the back-end.

 

Good Luck,

 

Phil

Phil Lefort
PSO Senior Field Engineer
Office: 650-216-2173
Cell: 650-743-1917
phil.lefort@tumbleweed.com 
www.tumbleweed.com
Gartner 2008 MFT Magic Quadrant
Tumbleweed Positioned in Leaders Quadrant
http://www.tumbleweed.com/mft

________________________________

From: Mohammad Kargar - Indicee [mailto:MohammadK@indicee.com] 
Sent: Sunday, July 20, 2008 7:19 PM
To: users@httpd.apache.org
Subject: [users@httpd] ProxyPass redirects the request

 

I'm using the following configuration to setup my local Apache as a
reverse proxy for the app server (let's call it
http://www.backend.com/). The problem is that apache server redirects
all the requests to /mytest/ to the backend (http://www.backend.com/)
instead of transparently providing the content from it. 

 

Does anybody know what I'm missing here?

 

 

ProxyRequests Off

 

<Proxy *>

Order deny,allow

Allow from all

</Proxy>

 

ProxyPass /mytest/ http://www.backend.com/

ProxyPassReverse /mytest/ http://www.backend.com/

 

 

 

-Thanks,

 

Mohammad


"Tumbleweed Communications <tumbleweed.com>" made the following
 annotations on 08/03/08, 21:17:58
------------------------------------------------------------------------------
=== Tumbleweed Communications Disclaimer === 

This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed.  If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. 
 

Tumbleweed Communications Corp., an industry leader in managed file
transfer and content security, provides enterprise-class solutions to
organizations of all sizes. Tumbleweed's innovative products enable
organizations to effectively manage and protect business-critical
Internet communications, with capabilities that span secure file
transfer, encryption, data loss prevention, and email security.


==============================================================================

Re: [users@httpd] ProxyPass redirects the request

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, Jul 21, 2008 at 8:51 AM, Merton Campbell Crockett
<m....@roadrunner.com> wrote:
>
> On 20 Jul 2008, at 19:19:07, Mohammad Kargar - Indicee wrote:
>
> I'm using the following configuration to setup my local Apache as a reverse
> proxy for the app server (let's call ithttp://www.backend.com/). The problem
> is that apache server redirects all the requests to /mytest/ to the backend
> (http://www.backend.com/) instead of transparently providing the content
> from it.
>
> Does anybody know what I'm missing here?
>
> You probably want to use mod_rewrite.  Look at one of Ralph Engelschall's
> monographs that provides insight on how to use it.

Ouch. That's a little like responding to someone who asked the
question "I'd like a glass of water please" with the response "Take a
look at these three advanced chemistry books."

There is nothing inherently wrong with the initial config setup posted
by Mohammad. The question is to figure out where the redirect is
coming from and why it isn't getting rewritten by ProxyPassReverse.
There is a good chance the redirect is coming from some javascript or
something similar on the back-end that can't be rewritten at the HTTP
header level.

So your first step should be to look at exactly what content the
back-end is returning in response to the requests and figure out why
they trigger a redirect at the browser. If you need help doing this,
people on this list can probably suggest some tracing tools.

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] ProxyPass redirects the request

Posted by Merton Campbell Crockett <m....@roadrunner.com>.
On 20 Jul 2008, at 19:19:07, Mohammad Kargar - Indicee wrote:

> I’m using the following configuration to setup my local Apache as a  
> reverse proxy for the app server (let’s call ithttp://www.backend.com/) 
> . The problem is that apache server redirects all the requests to / 
> mytest/ to the backend (http://www.backend.com/) instead of  
> transparently providing the content from it.
>
> Does anybody know what I'm missing here?

You probably want to use mod_rewrite.  Look at one of Ralph  
Engelschall's monographs that provides insight on how to use it.

Merton Campbell Crockett
m.c.crockett@roadrunner.com