How to load different views based on the domains if the client application is behind the apache2 proxy. Going to details - CAS client configuration requires "serverName" parameter.
"The name of the server this application is hosted on. Service URL will be dynamically constructed using this, i.e.
https://localhost:8443 (you must include the protocol, but port is optional if it's a standard port)."). Based on it and the relevant service registers, CAS can decide which template to load.
However, my problem comes down to the question of how to load the right view when I am using apache2 and virtual glassfish servers.
<VirtualHost *:433>
ProxyPreserveHost On
ProxyTimeout 1500
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
SetEnv proxy-initial-not-pooled 1
RewriteEngine On
RewriteCond /var/www/maintenance.html -f
RewriteCond %{REQUEST_FILENAME} !/maintenance.html
RewriteRule ^.*$ /var/www/maintenance.html [L]
</VirtualHost>
<VirtualHost *:433>
ProxyPreserveHost On
ProxyTimeout 1500
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
SetEnv proxy-initial-not-pooled 1
RewriteEngine On
RewriteCond /var/www/maintenance.html -f
RewriteCond %{REQUEST_FILENAME} !/maintenance.html
RewriteRule ^.*$ /var/www/maintenance.html [L]
</VirtualHost>
Going to the application through the
test1.domain.com, the service parameter will look like this
However, it will look the same with
test2.domain.com, therefore, cas will not load different views because my client has a clearly defined only one ${cas.service.host}
<bean id="casAuthenticationFilter" class="org.jasig.cas.client.authentication.AuthenticationFilter">
<property name="casServerLoginUrl" value="${cas.server.host}/login"/>
<property name="serverName" value="https://${cas.service.host}"/>
</bean>
Thanks in advance for your help, any suggestions are welcome.