Replies: 1 comment
-
Hi @morandd The reverse proxy issue is something that has been reported multiple times but I believe each time the real problem was solved on the proxy side with specific configuration in the docker-compose config there is a proxy setup we run to test titiler https://github.com/developmentseed/titiler/blob/main/docker-compose.yml#L56-L69 and it seems to work fine. If there is an issue, I would suspect it would be on starlette or on uvicorn side |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a TiTiler app running in Kubernetes , using a Traefik reverse proxy for HTTPS and the virtual domain at [titiler.mycompany.com]
The /cog/viewer endpoint does not work. The MapLibre instance is requesting information about the GeoTIFF I'm viewing and dispatching an AJAX request like:
http://localhost:5020/cog/info.geojson?url=[URL to my .tif]
This of course refers to "localhost:5020", which is the Docker instance, instead of https://titiler.mycompany.com
I believe the issue lies at least in lines 36-43 in
https://github.com/developmentseed/titiler/blob/main/src/titiler/extensions/titiler/extensions/viewer.py
There I believe the "info.geojson" is defined relative to the request URL, which is the URL as received behind the reverse proxy. For example lines
40: "info_endpoint": factory.url_for(request, "info_geojson"),
41: "statistics_endpoint": factory.url_for(request, "statistics"),
A possible solution would be to add an optional environment variable "TITILER_BASE_URL". Then a user could set a value like "https://titiler.mycompany.com". Then, adjust line 40, 41, and other affected lines, to use this TITILER_BASE_URL if provided otherwise the "request" url as the base.
Beta Was this translation helpful? Give feedback.
All reactions