I had an Apache and Glassfish setup designed to redirect all traffic to a server or its alias to the glassfish port. This worked fine, however we required more services to be added to the server so we can't just force all traffic down one port.
What I wish to do is if users use the standard name for the server, it stays in apache but if they use the alias of the server all traffic is then routed to the glassfish port. How is this possible?
This is the current configuration
ServerName [name]
ServerAlias [alias]
SSLProxyEngine on
ProxyPreserveHost on
ProxyRequests on
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?[name] [NC]
RewriteRule (.*) https://[name]/$1 [L,R=301]
#RewriteCond %{HTTPS} off
#ProxyPass / https://[alias]:443/
#ProxyPassReverse / https://[alias]:443/
#Redirect / https://[alias]:443/
Originally the commented lines were uncommented which forced all traffic over to 443 which then goes into the glassfish port. These lines were disabled to allow standard http traffic to work as intended
<VirtualHost>
.