I have a Java Web app in my tomcat, and I put Apache2 HTTP as my reverse proxy. Actually I already made a (quite) good redirection, but I wanna make it better.
My Virtual Host setting for redirecting to my tomcat web app is like below
<VirtualHost *:443>
ServerAdmin [email protected]
ServerName mywebapp.mydomain.com
ProxyRequests off
ProxyPreserveHost on
ErrorLog /usr/log/tomcat/tomcat.error.log
CustomLog /usr/log/tomcat/tomcat.log combined
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / ajp://localhost:8009/MyWebApp
ProxyPassReverse / ajp://localhost:8009/MyWebApp
Redirect / /MyWebApp
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
</VirtualHost>
With the above setting, I can reach my web app by typing: https://mywebapp.mydomain.com perfectly.
The only concern is: when my app is rendered on browser, I can see that the path is become like: https://mywebapp.mydomain.com/MyWebApp/view/home.action
Is there anyway I can make it becomes: https://mywebapp.mydomain.com/view/home.action
Without disclosing my app folder in tomcat, which is MyWebApp ?
See if the following helps. I had used it a while back :
Looks like the above did not work. I thought the Redirect directive that you have would take care of it. Can you attempt the following ?