Hi, this is my vhost configuration:
<VirtualHost *:80>
DocumentRoot /var/www/htdocs
ServerName app.mydomain.com
RewriteEngine On
RewriteLog "/var/log/apache/rewrite.log"
RewriteLogLevel 9
RewriteRule ^/(.*) http:/%{REQUEST_URI}.app.mydomain.com:8080/b2b
[P]
</VirtualHost>
The application that runs on JBOSS, reads the profile template in URL
name. Example: If I type "http://client1.app.mydomain.com:8080/b2b", it
loads client1´s template.
So, I don´t want to force the client to type this complex url, but a
simple like "http://app.mydomain.com/client1" and make apache proxy
these resquests to my application on JBOSS.
The RewriteRule above is working, but it rewrites URL on browser´s
address bar to "http://client1.app.mydomain.com:8080/b2b" and I wan´t
to preserver the address "http://app.mydomain.com/client1".
Thanks again,
Fabricio.
--- Axel-Stéphane SMORGRAV <[EMAIL PROTECTED]>
escreveu:
> You probably get a redirection to http://localhost:8080, right?
>
> Add
>
> ProxyPassReverse / http://localhost:8080/
>
> This will replace any redirection to http://localhost:8080/ with a
> redirection to /.
>
> If that does not work, try to explain more thoroughly what the
> problem is, i.e. exactly what URL it is trying to request, and join
> the relevant lines from the access and error logs.
>
> -ascs
>
>
> -----Original Message-----
> From: Fabricio Luiz Machado [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 15, 2005 6:00 PM
> To: [email protected]
> Subject: RE: [EMAIL PROTECTED] ProxyPass with variables...
>
>
> Thanks Ian, it works.
> But I can´t use it, because it loads an URL with '8080' port... :-(
>
> Are there another way ?
>
> regards,
>
> Fabricio.
>
> --- Ian Huynh <[EMAIL PROTECTED]> escreveu:
>
> >
> > you can use mod_rewrite to change the URL and proxy at the same
> time.
> >
> > add these lines in your httpd.conf
> >
> > LoadModule proxy_module modules/mod_proxy.so
> > LoadModule proxy_http_module modules/mod_proxy_http.so
> > LoadModule rewrite_module modules/mod_rewrite.so
> >
> > RewriteEngine on
> > RewriteRule ^/(.*) http://localhost:8080/$1 [P,L]
> >
> > and remove your ProxyPass, ProxyPassReverse directives
> >
> > -----Original Message-----
> > From: Fabricio Luiz Machado [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, June 15, 2005 1:33 PM
> > To: apache.org
> > Subject: [EMAIL PROTECTED] ProxyPass with variables...
> >
> >
> > Hi there!
> >
> > I integrate Apache + JBOSS with mod_proxy and it´s working fine to
> me.
> > Now, I will have a big application, for hundreds of different
> profile
> > clients.
> >
> > These clients must access the application with an URL like this:
> >
> > http://app.mydomain.com/client1
> > http://app.mydomain.com/client2
> > http://app.mydomain.com/whatever
> >
> > And I have to proxy this requests like this:
> >
> > ProxyPass /client1 http://localhost:8080/client1 ProxyPassReverse
>
> > /client1 http://localhost:8080/client1
> >
> > ProxyPass /client2 http://localhost:8080/client2 ProxyPassReverse
>
> > /client2 http://localhost:8080/client2
> >
> > ProxyPass /whatever http://localhost:8080/whatever
> ProxyPassReverse
> > /whatever http://localhost:8080/whatever
> >
> > The problem, ist that I don´t want to manage this hundreds
> > 'ProxyPass'
> > directives one by one, because it will hurts...
> >
> > Is there a way to use variables to create an unique 'ProxyPass' ?
> > For example:
> > ProxyPass /%{VARIABLE} http://localhost:8080/%{VARIABLE}
> > ProxyPassReverse /%{VARIABLE} http://localhost:8080/%{VARIABLE}
> >
> > Any sugestions will be great...
> > Thanks!
> >
> > Fabricio.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > _______________________________________________________
> > Yahoo! Acesso Grátis - Internet rápida e grátis.
> > Instale o discador agora! http://br.acesso.yahoo.com/
> >
> >
> ---------------------------------------------------------------------
> > 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: [EMAIL PROTECTED]
> > " from the digest: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> ---------------------------------------------------------------------
> > 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: [EMAIL PROTECTED]
> > " from the digest: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>
>
>
>
> _______________________________________________________
> Yahoo! Acesso Grátis - Internet rápida e grátis.
> Instale o discador agora! http://br.acesso.yahoo.com/
>
> ---------------------------------------------------------------------
> 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: [EMAIL PROTECTED]
> " from the digest: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> 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: [EMAIL PROTECTED]
> " from the digest: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> ---------------------------------------------------------------------
> 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: [EMAIL PROTECTED]
> " from the digest: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
_______________________________________________________
Yahoo! Acesso Grátis - Internet rápida e grátis.
Instale o discador agora! http://br.acesso.yahoo.com/
---------------------------------------------------------------------
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: [EMAIL PROTECTED]
" from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]