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]# I here assume that ProxyPreserveHost is Off
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/
Envoyé : mercredi 2 janvier 2008 17:13
Objet : Re: Needing help with mod_proxyRewriteRule . http://127.0.0.1:3001 <http://127.0.0.1:3001> [L,P]
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
<Proxy *>
Order deny,allow
Allow from All
</Proxy>
RewriteEngine On
RewriteRule ^/$ /index.html [QSA]
RewriteCond %{REQUEST_URI} ^/otherappRewriteCond %{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 <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
" from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
![]() |