Skip to content

Conversation

@YuriiMotov
Copy link
Member

There is a wrong statement in current version of docs:

Passing the root_path to FastAPI would be the equivalent of passing the --root-path command line option to Uvicorn or Hypercorn.

This is described well in this discussion: #14220

Here is my attempt to fix docs.

It will also resolve the issues with mounted sub-apps and StaticFiles when app is run with root_path parameter passed to FastAPI - now it will be clear that running such configuration behind the stripping path proxy is not correct.


I haven't tested all these examples properly yet, will do it soon. Will be grateful if you can help with it :)

@YuriiMotov YuriiMotov added the docs Documentation about how to use FastAPI label Oct 27, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 27, 2025

@Pentusha

This comment was marked as resolved.

@simone-trubian
Copy link

simone-trubian commented Oct 28, 2025

Hi @YuriiMotov happy to help with the testing of the examples; for my understanding, which examples are you referring to?

@YuriiMotov
Copy link
Member Author

Hi @YuriiMotov happy to help with the testing of the examples; for my understanding, which examples are you referring to?

Great!
We need to test all 3 approaches described in new version - configure Traefik using the config example provided for this approach, run ASGI server as it's described in that approach, send proper requests (with prefix included) and confirm that everything works as expected.

We can also modify the code example of the app to include sub-app and StaticFiles to make sure it all works correctly in all 3 configurations

Copy link

@KarelRuzicka KarelRuzicka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Covers previously undocumented behaviour of root_proxy mentioned in #14220

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation about how to use FastAPI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants