Forum Moderators: phranque

Message Too Old, No Replies

Apache Proxy to Jboss shows IP address

         

veyond

2:23 am on Jan 15, 2009 (gmt 0)

10+ Year Member



I am trying to use Apache 2 to proxy requests for Jboss. Jboss sits in DMZ two and there is no direct access to it from the web. My requests go to a load balancer, which sends them to the web server and then i use ProxyPass to pass it to the application server (brackets indicate name change)

<VirtualHost *:80>
ServerName [domain]
ProxyPass /mv [10.100.1.1:8080...]
ProxyPass /mv [10.100.1.1:8080...]
</VirtualHost>

This works fine but in the browser the ip address shows up instead of the domain name. I am trying to use mod_rewrite to change the ip address back to the domain but I am not having any luck

RewriteEngine On
RewriteRule ^(.*)$ [domainname]/$1 [PT]

Is there a way to just have it rewrite the top level url to always be the same thing?

Caterham

1:29 pm on Jan 15, 2009 (gmt 0)

10+ Year Member



but in the browser the ip address shows up

And how? By a redirect issued by your application? By HTML links you're clicking on?

Why do you have two ProxyPass directives for the same URL-path /mv? I guess the second one should read ProxyPassReverse?

Not related, but I guess [pathtoapp] does not end with a slash (it shouldn't end with a slash because the path /mv has no trailing slash, too).

veyond

7:17 pm on Jan 15, 2009 (gmt 0)

10+ Year Member



Thank you for the reply. You are right, after I posted this I went back and realized i had not added the Reverse and it is now working.
Thanks for the confirmation