I have an Apache 2 interface that serves two types of requests:
- Requests to the root folder (e.g. http://mysite.com/ and http://mysite.com/help ) are handled by apache itself (PHP / Wordpress).
- Specific requests to the subfolder '/ playapp' are sent to Play! through reverse proxy through mod-proxy:
mod-proxy.conf
ProxyPass /playapp/ http://localhost:9000/ ProxyPassReverse /playapp/ http://localhost:9000/
The end result is that requests to say http://mysite.com/playapp/Controller/action reach the playback server as http://localhost:9000/Controller/action
Now, play! the page serves correctly, but all links, including javascript, css and links to other pages, are broken. For example, if a view uses:
#{stylesheet 'style.css' /}
Then the result
<link rel="stylesheet" type="text/css" href="/public/stylesheets/style.css" charset="utf-8" ></link>
So, the end user is trying to retrieve http://mysite.com/public/stylesheets/style.css , which returns 404 because it is not part of the Play! attachment.
What is the right way to configure Apache + Play to play here?
The result I'm looking for for Play! to return URLs, for example, to the final rendered HTML (or perhaps for Apache to rewrite URLs accordingly): http://mysite.com/playapp/public/stylesheets/style.css
Also, I need some connectivity outside of the Play app. For example, I want the home route (/) to be mapped to my absolute root ( http://mysite.com/ ), rather than root.
source share