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

STAC self links get garbled when eoAPI STAC API is behind an API gateway #103

Closed
1 task
j08lue opened this issue Dec 12, 2024 · 2 comments
Closed
1 task
Assignees

Comments

@j08lue
Copy link
Collaborator

j08lue commented Dec 12, 2024

When accessing https://eoapi.apx.develop.eoepca.org/stac/ I still get a self link with port number 9443: https://eoapi.apx.develop.eoepca.org:9443/stac/

When accessing the "old" URL https://eoapi.develop.eoepca.org/stac/ however, I get a correct self link.

Acceptance criteria

  • Self links are correct also when the STAC API is behind the IAM-deployed API gateway
@pantierra
Copy link
Collaborator

pantierra commented Jan 10, 2025

I've looked into this, and it seems we have to fix this on the gateway (APISIX) level.

The appended port issue is most likely related to an APISIX problem, which @w-scho appears to be actively addressing already. Additionally, at the stac-fastapi level, it is deliberately discouraged (1, 2) to set the base-url hard-coded.

@w-scho
Copy link

w-scho commented Jan 15, 2025

APISIX seems to always add an X-Forwarded-Port header with the value set to its container port (here: 9443). This is correct from APISIX's local perspective, but wrong from the global one.
We had tried to apply a simple gobal workaround for this, but apparently it did not cover all relevant cases.
Now after the demo event is over, I dared to experiment again and temporarily added an ApisixGlobalRule that applies the workaround from the Keycloak route globally. This actually seems to fix the problem. I hope that it does not cause any undesired side effects. If no complaints arise during the next few days, I will make the new rule permanent.

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

No branches or pull requests

3 participants