I have one web server running two sites on different ports. IE: server:8081 and server:8083 I setup two DNS records and pointed it to “my server”
Dev.server.com and Pre.server.com
I would like Dev.server.com to redirect to server:8083 but mask the URL to always stay Dev.server.com and Pre.server.com to redirect to server:8081 but mask the URL to always stay pre.server.com
If I set them up like this
<VirtualHost *:80>
ServerName http:// Dev.server.com
ProxyRequests off
ProxyPass / http://server:8083
ProxyPassReverse / http://server:8083
</VirtualHost>
<VirtualHost *:80>
ServerName http:// Pre.server.com
ProxyRequests off
ProxyPass / http://server:8081
ProxyPassReverse / http://server:8081
</VirtualHost>
Everything routes to the Dev instance and nothing makes it to the Pre instance
I have it set like this;
<VirtualHost *:80>
ServerName http:// Dev.server.com
RewriteEngine On
RewriteCond %{HTTP_HOST} ^dev\.server\.com$ [NC]
RewriteRule ^(.*)$ http:// Dev.server.com:8083$1 [R]
RewriteCond %{HTTP_HOST} ^pre\.server\.com$ [NC]
RewriteRule ^(.*)$ http://pre. server.com:8081$1 [R]
</VirtualHost>
Listen 0.0.0.0:8083
Listen 0.0.0.0:8081
<VirtualHost *:8083>
ServerName dev. server.com
ProxyRequests off
ProxyPass / http:// server.com:8083/jde/owhtml/
ProxyPassReverse / http:// server.com:8083/jde/owhtml/
Oc4jMount /jde HTML_DV_8083
Oc4jMount /jde/* HTML_DV_8083
</VirtualHost>
<VirtualHost *:8081>
ServerName pre.server.com
ProxyRequests off
ProxyPass / http:// server.com:8081/jde/owhtml/
ProxyPassReverse / http:// server.com:8081/jde/owhtml/
Oc4jMount /jde HTML_PY_8081
Oc4jMount /jde/* HTML_PY_8081
</VirtualHost>
This works perfectly for the routing but does not mask the URL. It adds the port to the URL witch we do not want to happen.
Anyone have any ideas as to what I am doing wrong?
http://
– Jon Lin Sep 3 '13 at 19:23