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>

    ServerName test1.domain.com

    ProxyPass /WebApp http://test1.domain.com:8081/WebApp
    ProxyPassReverse /WebApp http://test1.domain.com:8081/WebApp
    ProxyPass / http://test1.domain.com:8081/WebApp
    ProxyPassReverse / http://test1.domain.com:8081/WebApp

    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>

    ServerName test2.domain.com

    ProxyPass /WebApp http://test2.domain.com:8081/WebApp
    ProxyPassReverse /WebApp http://test2.domain.com:8081/WebApp
    ProxyPass / http://test2.domain.com:8081/WebApp
    ProxyPassReverse / http://test2.domain.com:8081/WebApp

    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
https://sso.server.com/cas/login?service=https%3A%2F%2Ftest1.domain.com%2FWebApp%2F
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.

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cas-user+unsubscr...@apereo.org.
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/58b338cd-281d-4eb0-91f9-c2cc30b2e64a%40apereo.org.

Reply via email to