stac-fastapi icon indicating copy to clipboard operation
stac-fastapi copied to clipboard

Allowing to fix the request base URL

Open constantinius opened this issue 2 years ago • 2 comments

The base URL in links is built using the Starlette Request base_url property. But this value can be misleading, especially when the app is used behind a proxy.

It would help if the base URL can be configured somehow.

constantinius avatar Jun 21 '23 21:06 constantinius

I was trying to deploy stac-fastapi using traefik so that when I hit myurl.com/stac/ the links in the catalog contain the "/stac" prefix. Related to #223 and #581

I think it would be useful if we could use an environment variable to configure the --root-path instead of manually having to modify the fastapi command.

betolink avatar Mar 01 '25 16:03 betolink

https://github.com/stac-utils/stac-fastapi/blob/main/stac_fastapi/types/stac_fastapi/types/config.py#L34

vincentsarago avatar Mar 02 '25 15:03 vincentsarago