I've got a single linux server running Apache/2.2.24 running both HTTP/HTTPS along with a Glassfish 3.1.2 server listening on port 8080.
Glassfish runs a single deployed application which has subfolders for separate websites, e.g.:
http://gfish:8080/rootSite
http://gfish:8080/rootSite/Site2
http://gfish:8080/rootSite/Site3
http://gfish:8080/rootSite/Site4
In the Apache vhosts.conf
file all traffic to port 80 of each Virtual Host is re-written to 443 as follows:
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{HTTPS} !on
RewriteRule ^(.*)$ https://www.site2.com/rootSite/Site2$1 [L,R]
In the Apache ssl.conf
file each virtual host is configured to pass off to Glassfish as follows:
RedirectMatch ^/$ https://www.site2.com/rootSite/Site2$1
ProxyPass /rootSite/ http://gfish:8080/rootSite/
ProxyPassReverse /rootSite/ http://gfish:8080/rootSite/
The end result for a web-user is that when they navigate to http://www.site2.com
they are redircted to HTTPS and proxied to Glassfish resulting in them seeing: https://www.site2.com/rootSite/Site2
This is the current working configuration.
The desired results is that the web-user does not see the subfolder and sees the site as: https://www.site2.com
What is the most efficient way to accomplish this given the existing configuration?
EDIT:
After some toying around it appears that some of the configuration within the ssl.conf file is unnecessary. I trimmed it down to the following:
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://gfish:8080/rootSite/Site2/
ProxyPassReverse / http://gfish:8080/rootSite/Site2/`
With this new configuration I am able to omit the /rootSite/Site2/ from the URL as desired however all CSS formatting and images are broken.