Add ROOT_PATH env variable to simplify running Titiler behind a proxy #343
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'd really like to get Titiler running on an existing server, and have requests to the root path
/titiler
passed to a running docker container running on, e.g. port 9000. However, there's currently no way to specify the root_path parameter in the FastAPI instantiation, so the app has been required to run at the root location/
. (see FastAPI docs on running behind a proxy)This PR allows users to set the root_path parameter of the FastAPI instance via an environment variable so that it's dead simple to run the service behind a reverse proxy. It defaults that root_path location to "/", so nothing anybody currently has running breaks.
I suspect that for this to be accepted, some documentation has to be written up for this behaviour. I'm just not sure where that should go. If someone wants to tell me where to put that, I can fill in those details.