Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added proxy header middleware from stac-fastapi #105

Closed
wants to merge 4 commits into from

Conversation

ivica3730k
Copy link

Hello!

We have been using titiler-pgstac for some time now, and just recently we started putting it behind Azure API Management.

This works nice and fine, however, the URLs that are in the return payload are wrong as the APIM has a different hostname.

I just decided to copy in a proxy middleware part from stac-fastapi. Main might not be the place to add it but that is the general idea. This configuration works for us:

image

@vincentsarago
Copy link
Member

about the original issue, I'm still surprised we need this kind of solution. IMO it should be handled by starlette directly

we have add multiple issues in titiler developmentseed/titiler#342

ref: encode/starlette#604

If this is really a titiler-pgstac issue then we can add this middleware but we should add it in a separate submodule and add tests

@ivica3730k
Copy link
Author

about the original issue, I'm still surprised we need this kind of solution. IMO it should be handled by starlette directly

we have add multiple issues in titiler developmentseed/titiler#342

ref: encode/starlette#604

If this is really a titiler-pgstac issue then we can add this middleware but we should add it in a separate submodule and add tests

It does seem a bit like it is a different issue to me, or maybe I am getting my terminology wrong. In our case, API Management runs on a different machine than the titiler-pgstac itself, with a different domain pointed to it. Would root_path param be enough in that case even if it was available to use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants