Open tobwen opened 3 years ago
You're right, the backend application has hardcoded paths assuming running on /
. A workaround could be copying and adjusting the backend HTML/CSS/JS files and serve them as static assets (https://t-rex.tileserver.ch/doc/reference/#webserver)
background
I'm running NGINX as a remote proxy for t-rex on endpoint
example.org/mvt/
. I want to be able to have access to the "debug view" of t-rex, which is protected by HTTP Basic authentication.issue
It seems like t-rex is designed to work on the root endpoint only (
example.org/
). All the static websites are linked to root, f.e. https://github.com/t-rex-tileserver/t-rex/blob/d5a67c47a1e2cf21a29b63bf820ed749f1cad911/t-rex-webserver/src/static/index.html#L1As you can see, index.html always tries to read the JS-files from
example.org/
instead ofexample.org/mvt/
- so normal rewriting the URL doesn't help.what I've tried
static
directory. It loaded up, but the layers haven't been loaded. It all resulted to NULL only. Seems likestatic
cannot be used for this.suggestions
MapProxy and other applications listen to the
X-Script-Name
and take care of this. With https://github.com/t-rex-tileserver/t-rex/issues/83 you actually have similar abilities, but for the JSON files, not for the "debug view". Could you add this? It would be really nice to have a realtime look into the data, even when it's running on a non-root location.