Open jrandall opened 11 years ago
In Play 1.x there was an http.path option (http://www.playframework.com/documentation/1.2.5/configuration#http.path) that seems to address this issue, but it doesn't seem to work in Play 2.x.
When running behind the reverse proxy, we have the usermod app installed externally under '/api/usermod/', which is proxied back to Play as '/'. So, routing works fine, but for some reason Play makes all of its links absolute to '/' which means they are all broken. We need a hook that sets a prefix on every URL linked within the app to prepend a configurable string before it.
The '/@evolutions/...' appears to be hardcoded into the evolutions plugin: https://github.com/playframework/Play20/blob/master/framework/src/play-jdbc/src/main/scala/play/api/db/evolutions/Evolutions.scala
This would seem to make it impossible to use the Play framework (or at least this plugin) when installed under anything other than the root of the externally visible domain.
Hmm, that's a bit annoying. However, the evolutions script is likely to only need to run once, when we first set the thing up, so I'd suggest we just apply that through accessing the play server directly.
Ok, we should just make sure we have some config setting for our own URLs that sets the base (or else uses only relative URIs, although I think absolute URIs would be more useful in the JSON since it is not well defined what the default base would be for a json document).
The "Apply this script now!" button that initialises the database goes to '/@evolutions/apply/default?redirect=...' instead of '@evolutions/apply/default?redirect=...'
This is a problem when the site is accessible via a reverse proxy. If I manually correct the above link to initialize the database, then the "Browse APIs" documentation link also goes to a broken link (e.g. '/@documentation/api/scala/index.html') instead of '@documentation/...'