Skip to content

fix(nginx): generate nginx.conf dynamically with ROOT_PATH (#97)#98

Merged
rbardaji merged 2 commits intomainfrom
fix/97-nginx-root-path-prefix
Apr 8, 2026
Merged

fix(nginx): generate nginx.conf dynamically with ROOT_PATH (#97)#98
rbardaji merged 2 commits intomainfrom
fix/97-nginx-root-path-prefix

Conversation

@rbardaji
Copy link
Copy Markdown
Collaborator

@rbardaji rbardaji commented Apr 8, 2026

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/default at startup using ROOT_PATH as prefix for all locations. Also updates the config.js script path in the built index.html.

How it works

When ROOT_PATH=/ep-api, the generated nginx.conf has:

  • location /ep-api/ui/ → serves static UI files
  • location /ep-api/api/ → proxies to uvicorn (strips prefix)
  • location /ep-api/ → proxies to uvicorn (strips prefix)

When ROOT_PATH is empty, locations are /ui/, /api/, / — identical to the previous static config.

Test plan

  • All 1011 tests pass
  • curl localhost:8002/ep-api/ui/ → 200
  • curl localhost:8002/ep-api/health → 200
  • curl localhost:8002/ep-api/ui/config.js → 200
  • Generated nginx.conf has correct prefixed locations
  • Built index.html loads config.js from /ep-api/ui/config.js

@rbardaji rbardaji merged commit 29ad303 into main Apr 8, 2026
1 check passed
@rbardaji rbardaji deleted the fix/97-nginx-root-path-prefix branch April 8, 2026 12:01
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.

Nginx inside container does not use ROOT_PATH for location prefixes

1 participant