FastAPI Root Path Option is Ignored #130

Closed
opened 2026-02-16 00:18:55 -05:00 by yindo · 4 comments
Owner

Originally created by @sbachstein on GitHub (Feb 27, 2024).

When deploying behind a reverse proxy, you often rewrite/truncate the HTTP paths and remove some API URL prefix. In order to compensate for that, FastAPI offers the root_path option. That way, things like the /docs endpoint for the Swagger UI still work.

Langserve, however, does not take the root_path into account and, thus, the Langserve Playground does not work correctly. That's because any additional requests (CSS/JS) point to the wrong URL (missing the root path prefix).

Originally created by @sbachstein on GitHub (Feb 27, 2024). When deploying behind a reverse proxy, you often rewrite/truncate the HTTP paths and remove some API URL prefix. In order to compensate for that, FastAPI offers the `root_path` option. That way, things like the `/docs` endpoint for the Swagger UI still work. Langserve, however, does not take the `root_path` into account and, thus, the Langserve Playground does not work correctly. That's because any additional requests (CSS/JS) point to the wrong URL (missing the root path prefix).
yindo closed this issue 2026-02-16 00:18:55 -05:00
Author
Owner

@nat-n commented on GitHub (Feb 27, 2024):

workin' on a fix here :) #472

@nat-n commented on GitHub (Feb 27, 2024): workin' on a fix here :) #472
Author
Owner

@sbachstein commented on GitHub (Feb 27, 2024):

Awesome, thank you for working on it!

@sbachstein commented on GitHub (Feb 27, 2024): Awesome, thank you for working on it!
Author
Owner

@eyurtsev commented on GitHub (Feb 28, 2024):

Merged and will be released in a few

@eyurtsev commented on GitHub (Feb 28, 2024): Merged and will be released in a few
Author
Owner

@eyurtsev commented on GitHub (Feb 28, 2024):

Thank you @nat-n

@eyurtsev commented on GitHub (Feb 28, 2024): Thank you @nat-n
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langserve#130