Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 16242 invoked from network); 2 Jan 2008 17:39:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jan 2008 17:39:31 -0000 Received: (qmail 98029 invoked by uid 500); 2 Jan 2008 17:39:08 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 98006 invoked by uid 500); 2 Jan 2008 17:39:08 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 97995 invoked by uid 99); 2 Jan 2008 17:39:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jan 2008 09:39:08 -0800 X-ASF-Spam-Status: No, hits=4.4 required=10.0 tests=HTML_MESSAGE,HTTP_ESCAPED_HOST,NORMAL_HTTP_TO_IP,SPF_PASS,URIBL_RHS_DOB,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of btricha@gmail.com designates 64.233.184.224 as permitted sender) Received: from [64.233.184.224] (HELO wr-out-0506.google.com) (64.233.184.224) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jan 2008 17:38:43 +0000 Received: by wr-out-0506.google.com with SMTP id 37so138675wra.12 for ; Wed, 02 Jan 2008 09:38:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=ucVMZDXMI9mQ8WOTTtSqplXWcyp2/pYvgbF4Cl8kCHQ=; b=BEaTmfhFN3dDXwql8Hg+yV+pIVUyWewnt8Q/yBj8J88xWyrw9FNk+I550pKNrB5OMXjw/VE8wj4yEFw6k06AY1QLW5Vz13uf5pXISxes6i9Fl2TXO01okMLdzbpdToIO+jFiPYT49TJPkqo4LMy8nsvvo8kxHIKUl29thH+D2zk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=u/QQWKEFXfbRHZ6XHC1DuJlZse3zGw0yfa60kvXEVH6P2N+G0MTaHttC6kczuJ/YDDfN1mM0D9nfWp9llWpxTXW14rOF/xXVRRY22Zvwy6yLSYE8Ehq79xMVJOcc+Gdtmq+mcixgPJ0xzHLCbSE8IQJaQvIi8AhYaNsOh5y1XO8= Received: by 10.151.10.7 with SMTP id n7mr3845858ybi.75.1199295527444; Wed, 02 Jan 2008 09:38:47 -0800 (PST) Received: by 10.150.182.8 with HTTP; Wed, 2 Jan 2008 09:38:47 -0800 (PST) Message-ID: <3f81a4240801020938j6f0f766ob37caf2ce27b51a7@mail.gmail.com> Date: Wed, 2 Jan 2008 10:38:47 -0700 From: "Bryan Richardson" To: users@httpd.apache.org In-Reply-To: <28D87C00C6E83540A814CFAE3FA63E3F53A24C@EXCHSUR.gaia.fr> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_9910_23909523.1199295527401" References: <3f81a4240712311824r4f6e7a0bj1838d6faab934cca@mail.gmail.com> <28D87C00C6E83540A814CFAE3FA63E3F539E97@EXCHSUR.gaia.fr> <3f81a4240801020813v32eec263o107f0de5695caa0c@mail.gmail.com> <28D87C00C6E83540A814CFAE3FA63E3F53A24C@EXCHSUR.gaia.fr> X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] Needing help with mod_proxy ------=_Part_9910_23909523.1199295527401 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Axel, Again, thanks for your help. However, I made the changes you suggested but I'm still getting the same result. Below is what I have. Also, nothing is showing up in my logs about rewrites... and I made sure I have ErrorLog specified. I hate to keep bugging you so don't worry about it if you don't have time. RewriteEngine On RewriteLogLevel 9 RewriteRule ^/$ /index.html [R] RewriteCond %{REQUEST_URI} ^/otherapp(.*) RewriteRule . http://127.0.0.1:3001%1 [L,P] RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f RewriteRule . http://127.0.0.1:3000%{REQUEST_URI} [L,P] ProxyPassReverse /otherapp/ http://127.0.0.1:3001/ ProxyPassReverse / http://127.0.0.1:3000/ Thanks again! -- BTR On Jan 2, 2008 9:36 AM, Axel-Stephane SMORGRAV < Axel-Stephane.SMORGRAV@europe.adp.com> wrote: > My fault. I guess that what is happening is that the browser is being > redirected and the Location header is not rewritten because I omitted the > ProxyPassReverse directives. > > Try adding: > > ProxyPassReverse /otherapp/ http://127.0.0.1:3001/ > ProxyPassReverse / http://127.0.0.1:3000/ > > There is another problem due to you removal of the %{REQUEST_URI} for > /otherapp. You do not want to strip off the whole URI while proxying. You > probably only want to strip off /otherapp. So now try this configuration: > > RewriteEngine On > RewriteLogLevel 9 > > # You should not need this if you use mod_dir > RewriteRule ^/$ /index.html [R] > > RewriteCond %{REQUEST_URI} ^/otherapp(.*) > RewriteRule . http://127.0.0.1:3001%1 [L,P] > > RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f > RewriteRule . http://127.0.0.1:3000%{REQUEST_URI}[L,P] > > # I here assume that ProxyPreserveHost is Off > ProxyPassReverse /otherapp/ http://127.0.0.1:3001/ > ProxyPassReverse / http://127.0.0.1:3000/ > > > -ascs > > ________________________________ > > De : Bryan Richardson [mailto:btricha@gmail.com] > Envoy=E9 : mercredi 2 janvier 2008 17:13 > =C0 : users@httpd.apache.org > Objet : Re: [users@httpd] Needing help with mod_proxy > > > Hi again Axel. I tried out what you said and I'm still having some > problems. Below is what I have in my site's config file. This makes it > possible for me to go to www.mysite.com/otherapp and I will get forwarded > to my Rails app server at port 3001. Notice I had to leave %{REQUEST_URI= } > off the end of the RewriteRule for my otherapp rule. However, if I then > click on a link within my Rails app, it tries to go to > www.mysite.com/controller rather than www.mysite.com/otherapp/controller. > How can I make it such that my Rails app thinks that > www.mysite.com/otherapp is its root rather than www.mysite.com? Thanks > again for your help! -- BTR > > > Order deny,allow > Allow from All > > > RewriteEngine On > RewriteRule ^/$ /index.html [QSA] > RewriteCond %{REQUEST_URI} ^/otherapp > RewriteRule . http://127.0.0.1:3001 [L,P] > RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f > RewriteRule . http://127.0.0.1:3000%{REQUEST_URI}[L,P] > > --------------------------------------------------------------------- > The official User-To-User support forum of the Apache HTTP Server Project= . > See 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 > > ------=_Part_9910_23909523.1199295527401 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Axel,

Again, thanks for your help.  However, I made the changes= you suggested but I'm still getting the same result.  Below is wh= at I have.  Also, nothing is showing up in my logs about rewrites... a= nd I made sure I have ErrorLog specified.  I hate to keep bugging you = so don't worry about it if you don't have time.

  RewriteEngine On
  RewriteLogLevel 9

  R= ewriteRule ^/$ /index.html [R]
  RewriteCond %{REQUEST_URI} ^/other= app(.*)
  RewriteRule . http://= 127.0.0.1:3001%1 [L,P]
  RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
  Re= writeRule . http://127.0.0.= 1:3000%{REQUEST_URI} [L,P]

  ProxyPassReverse /otherapp/ http://127.0.0.1:3001/
  ProxyPassReverse / http://127.0.0.1:3000/

Thanks again! -- BTR
<= br>
On Jan 2, 2008 9:36 AM, Axel-Stephane SMORGR= AV < Axel-Stephane.SMOR= GRAV@europe.adp.com> wrote:
My fault. I guess that what is happening is that the browser is being redir= ected and the Location header is not rewritten because I omitted the ProxyP= assReverse directives.

Try adding:

ProxyPassReverse /otherapp= /=20 http://127.0.0.1:3001/=
ProxyPassReverse / http://127.0.0.1:3000/

There is another problem due to you = removal of the %{REQUEST_URI} for /otherapp. You do not want to strip off t= he whole URI while proxying. You probably only want to strip off /otherapp.= So now try this configuration:

 RewriteEngine On
 RewriteLogLevel 9

 #= You should not need this if you use mod_dir
 RewriteRule ^/$ /ind= ex.html [R]

 RewriteCond %{REQUEST_URI} ^/otherapp(.*)
&nb= sp;RewriteRule . http://127.0.0.1:3001%1 [L,P]

 Rewri= teCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
 RewriteRule . http://12= 7.0.0.1:3000%{REQUEST_URI} [L,P]

 # I here assume that ProxyPreserveHost is Of= f
 ProxyPassReverse /otherapp/ http://127.0.0.1:3001/
 ProxyPassReverse / <= a href=3D"http://127.0.0.1:3000/" target=3D"_blank"> http://127.0.0.1:3000/


-ascs

__= ______________________________

De : Bryan Richardson [mailto:btricha@gmail.com]
Envoy=E9 : me= rcredi 2 janvier 2008 17:13
Objet : Re: [users@httpd] Needing help w= ith mod_proxy


Hi again Axel.  I tried= out what you said and I'm still having some problems.  Below is w= hat I have in my site's config file.  This makes it possible for m= e to go to=20 www.mysite.com= /otherapp and I will get forwarded to my Rails app server at port 3001.=  Notice I had to leave %{REQUEST_URI} off the end of the RewriteRule = for my otherapp rule.  However, if I then click on a link within my Ra= ils app, it tries to go to=20 www.mysite.c= om/controller rather than www.mysite.com/otherapp/controller.  Ho= w can I make it such that my Rails app thinks that=20 www.mysite.com= /otherapp is its root rather than www.mysite.com?  Thanks again for your help! -- BTR=

 <Proxy *>
   Order deny,allow
   Allow from All
&nbs= p;</Proxy>

 RewriteEngine On
 RewriteRule ^/$ /= index.html [QSA]
 RewriteCond %{REQUEST_URI} ^/otherapp
=  RewriteRule . http://127.0.0.1:3001 <http://127.0.0.1:3001> [L,P]
 = RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
 RewriteRule .= http://127.0.0.1:3000%{REQUEST_URI} [L,P]

=
-----------------------------------------------------= ----------------
The official User-To-User support forum of the Apache H= TTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
  "   from the di= gest: users-di= gest-unsubscribe@httpd.apache.org
For additional commands, e-mail: <= a href=3D"mailto:users-help@httpd.apache.org"> users-help@httpd.apache.org


------=_Part_9910_23909523.1199295527401--