On our Ubuntu webserver we have a Apache2 HTTP server in conjunction with an JSF application running on an Tomcat8 application server using AJP 1.3 connector and HTTPS/SSL. I want my app which runs on localhost:8009/myApp/ to be accessible from https://subdomain.domain.com (subdomain and domain are palceholders of course). In other words, I want different context paths (/ on apache2, /myApp on tomcat)
Now I'm facing the problem that - althougth the welcome-page is accessible - all resources/images/links are broken as they still contain the context path /myApp. I've tried to set up corresponding ProxPass/ReverseProxyPass settings without success.
<VirtualHost _default_:443>
ServerAdmin admin@domain.com
DocumentRoot /srv/www/subdomain.domain.com
ServerName subdomain.domain.com
RewriteEngine On
RewriteCond %{HTTP_HOST} !^subdomain\.domain\.com$ [NC]
RewriteRule .? https://subdomain.domain.com%{REQUEST_URI} [R=301,L]
<Location />
ProxyPass ajp://localhost:8009/myApp/ connectiontimeout=5 timeout=300
ProxyPassReverse https://localhost:8080/myApp/
ProxyPassReverse https://subdomain.domain.com/myApp/
ProxyPassReverse ajp://localhost:8009/myApp/
ProxyPassReverseCookiePath /myApp/ /
#Order deny,allow
Allow from all
</Location>
</VirtualHost>
PS: As a workaround, myApp currently runs on the root-context "/" on tomcat, but I want to change that to accomondate multiple web apps.
In tomcat's conf/server.xml I have the following connector configured:
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"
address="127.0.0.1"
proxyName="subdomain.domain.com" proxyPort="443" secure="true" />