fix(nginx): generate nginx.conf dynamically with ROOT_PATH (#97)#98
Merged
fix(nginx): generate nginx.conf dynamically with ROOT_PATH (#97)#98
Conversation
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.
Summary
Fixes #97 — The nginx configuration inside the all-in-one container had hardcoded location paths (
/ui/,/api/,/). When deployed behind a reverse proxy that forwards prefixed paths (e.g.,/ep-api/ui/...), nginx returned 404.Changes
entrypoint.sh: Now generates/etc/nginx/sites-available/defaultat startup usingROOT_PATHas prefix for all locations. Also updates theconfig.jsscript path in the builtindex.html.How it works
When
ROOT_PATH=/ep-api, the generated nginx.conf has:location /ep-api/ui/→ serves static UI fileslocation /ep-api/api/→ proxies to uvicorn (strips prefix)location /ep-api/→ proxies to uvicorn (strips prefix)When
ROOT_PATHis empty, locations are/ui/,/api/,/— identical to the previous static config.Test plan
curl localhost:8002/ep-api/ui/→ 200curl localhost:8002/ep-api/health→ 200curl localhost:8002/ep-api/ui/config.js→ 200/ep-api/ui/config.js