Skip to content

Commit 1879706

Browse files
authored
Add ROOT_PATH env variable to simplify running Titiler behind a proxy (#343)
* Allow specifying a root path for reverse proxy setups * Move root_path env loading to settings.py * Remove os.getenv call * Update changelog
1 parent a4f4a95 commit 1879706

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

CHANGES.md

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

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

9+
### titiler.application
10+
11+
* 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)
912

1013
## 0.3.3 (2021-06-29)
1114

src/titiler/application/titiler/application/main.py

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
title=api_settings.name,
3434
description="A lightweight Cloud Optimized GeoTIFF tile server",
3535
version=titiler_version,
36+
root_path=api_settings.root_path,
3637
)
3738

3839
if not api_settings.disable_cog:

src/titiler/application/titiler/application/settings.py

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class ApiSettings(pydantic.BaseSettings):
99
name: str = "titiler"
1010
cors_origins: str = "*"
1111
cachecontrol: str = "public, max-age=3600"
12+
root_path: str = ""
1213
debug: bool = False
1314

1415
disable_cog: bool = False

0 commit comments

Comments
 (0)