RSPEED-2417: Add root_path support for reverse proxy deployments#1136
Merged
tisnik merged 1 commit intolightspeed-core:mainfrom Feb 11, 2026
Merged
Conversation
Contributor
WalkthroughAdds a new ASGI Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Add root_path field to ServiceConfiguration with empty string default - Pass root_path to uvicorn.run() per FastAPI's recommended approach - Add unit tests for config default and uvicorn integration Signed-off-by: Major Hayden <major@redhat.com>
761eb0d to
9d50def
Compare
16 tasks
4 tasks
16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add a configurable
root_pathsetting toServiceConfigurationso Lightspeed Stack can be deployed behind load balancers and reverse proxies that route traffic on a non-root path prefix (e.g./api/lightspeed).The
root_pathvalue is passed touvicorn.run()at the ASGI server level, following FastAPI's recommended approach for proxy path prefix handling. This ensures OpenAPI docs, redirects, and all routing work correctly when the service sits behind a path-rewriting proxy.Default is an empty string (no change in behavior for existing deployments).
Type of change
Tools used to create PR
Related Tickets & Documents
Checklist before requesting a review
Testing
pytest tests/unit/models/config/test_service_configuration.py tests/unit/runners/test_uvicorn_runner.py— 9/9 passingmake verifypasses clean (pylint 10/10, pyright 0 errors, ruff/docstyle/mypy clean)root_path: /api/lightspeedinserviceconfig and confirm Swagger UI at/api/lightspeed/docsshows correct server URLSummary by CodeRabbit
New Features
Tests