I've tried changing the application.context in application.properties to "/" but this didn't help and it would not be a solution anyway since I want to be running multiple application instances in the same tomcat.
I also tried to set grails.resources.uri.prefix to various values such as:
- grails.resources.uri.prefix = "/static" => included file is: http://mysite.com:8080/appname//static/style.css, the file is now neither available at this location nor at http://mysite.com/static/style.css - grails.resources.uri.prefix = "../static" => included file is: http://mysite.com/static/style.css but the file is not found there; warning message in log is: "We can't create resources on the fly unless they are 'ad-hoc', we're going to 404"
I even tried setting grails.resources.processing.enabled = false since this is only a test server but that did not work either since in that case no resources are included at all. It works fine when I try it locally but not on the server where I'm running from a war file in the production environment. Is this the expected behavior?
Does anyone have any suggestions? Thanks in advance!
P.S.: To anyone who reads this because he wants to do the same thing: you'll also need to set: ProxyPassReverseCookiePath /appname /
To be honest I've always avoided situations where the front-end and
back-end context paths are different, for precisely these kinds of
reasons. However I've never really found it necessary since Tomcat
itself supports name-based virtual hosting. If you turn on
ProxyPreserveHost in your Apache configuration then you can configure
several <Host> blocks in the server.xml of a single Tomcat, each <Host>
having its own webapps directory and each responding to a different host
name (or names).