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

Add ROOT_PATH to config, pass it through to FastAPI #23

Merged
merged 2 commits into from
Jul 24, 2024
Merged

Conversation

mgeplf
Copy link
Contributor

@mgeplf mgeplf commented Jul 24, 2024

  • allows FastAPI to handle stripping the base url for incoming requests

* allows FastAPI to handle stripping the base url for incoming requests
@mgeplf mgeplf requested a review from GianlucaFicarelli July 24, 2024 07:52
@mgeplf mgeplf merged commit 875e2ba into main Jul 24, 2024
1 check passed
@mgeplf mgeplf deleted the add-root-path branch July 24, 2024 09:25
@pgetta
Copy link
Collaborator

pgetta commented Jul 24, 2024

Hi @mgeplf,

I randomly saw this change and from what I remember it might not work as you expect. You can read about this in this SO article.

In short, the app with a custom root_path still expects the path to be stripped by the proxy, which is not exactly our case, Application Load Balancer is passing requests as is without doing so.

For some other services I see the option 1 was used, e.g.: Virtual Lab API (see the BASE_PATH param).

I hope that helps.

@mgeplf
Copy link
Contributor Author

mgeplf commented Jul 24, 2024

Interesting, thanks for noticing.
I have a load balancer that is close to what is in production, in my sandbox, and the change seems to work there.
We shall see when I get this stuff deployed in prod.

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.

3 participants