Skip to content

Commit

Permalink
Add ROOT_PATH env variable to simplify running Titiler behind a proxy (
Browse files Browse the repository at this point in the history
…#343)

* Allow specifying a root path for reverse proxy setups

* Move root_path env loading to settings.py

* Remove os.getenv call

* Update changelog
  • Loading branch information
tayden authored Jul 27, 2021
1 parent a4f4a95 commit 1879706
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

* add `/crop` POST endpoint to return an image from a GeoJSON feature (https://github.com/developmentseed/titiler/pull/339)

### titiler.application

* add optional `root_path` setting to specify a url path prefix to use when running the app behind a reverse proxy (https://github.com/developmentseed/titiler/pull/343)

## 0.3.3 (2021-06-29)

Expand Down
1 change: 1 addition & 0 deletions src/titiler/application/titiler/application/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
title=api_settings.name,
description="A lightweight Cloud Optimized GeoTIFF tile server",
version=titiler_version,
root_path=api_settings.root_path,
)

if not api_settings.disable_cog:
Expand Down
1 change: 1 addition & 0 deletions src/titiler/application/titiler/application/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class ApiSettings(pydantic.BaseSettings):
name: str = "titiler"
cors_origins: str = "*"
cachecontrol: str = "public, max-age=3600"
root_path: str = ""
debug: bool = False

disable_cog: bool = False
Expand Down

0 comments on commit 1879706

Please sign in to comment.